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