moq/example/example.go

20 lines
421 B
Go
Raw Normal View History

2016-08-29 14:00:18 +02:00
package example
import "context"
2016-10-14 11:57:57 +02:00
//go:generate moq -out mockpersonstore_test.go . PersonStore
2016-08-31 14:05:37 +02:00
2016-11-06 13:37:55 +01:00
// Person represents a real person.
2016-08-29 14:00:18 +02:00
type Person struct {
ID string
Name string
Company string
Website string
}
2016-11-06 13:37:55 +01:00
// PersonStore provides access to Person objects.
2016-08-29 14:00:18 +02:00
type PersonStore interface {
2016-08-29 14:09:34 +02:00
Get(ctx context.Context, id string) (*Person, error)
2016-08-29 14:00:18 +02:00
Create(ctx context.Context, person *Person, confirm bool) error
}