Documentation
¶
Index ¶
- Constants
- type Intermediate
- type Mock
- func (svc *Mock) BulkCreate(ctx context.Context, objs []*yellowpagesapi.Person) (objKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Mock) BulkDelete(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (deletedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Mock) BulkLoad(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (objs []*yellowpagesapi.Person, err error)
- func (svc *Mock) BulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Mock) BulkRevise(ctx context.Context, objs []*yellowpagesapi.Person) (revisedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Mock) BulkStore(ctx context.Context, objs []*yellowpagesapi.Person) (storedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Mock) Count(ctx context.Context, query yellowpagesapi.Query) (count int, err error)
- func (svc *Mock) Create(ctx context.Context, obj *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, err error)
- func (svc *Mock) CreateREST(ctx context.Context, httpRequestBody *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, httpStatusCode int, err error)
- func (svc *Mock) Delete(ctx context.Context, objKey yellowpagesapi.PersonKey) (deleted bool, err error)
- func (svc *Mock) DeleteREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpStatusCode int, err error)
- func (svc *Mock) Demo(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) List(ctx context.Context, query yellowpagesapi.Query) (objs []*yellowpagesapi.Person, totalCount int, err error)
- func (svc *Mock) ListREST(ctx context.Context, q yellowpagesapi.Query) (httpResponseBody []*yellowpagesapi.Person, httpStatusCode int, err error)
- func (svc *Mock) Load(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, found bool, err error)
- func (svc *Mock) LoadREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpResponseBody *yellowpagesapi.Person, httpStatusCode int, err error)
- func (svc *Mock) Lookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, found bool, err error)
- func (svc *Mock) MockBulkCreate(...) *Mock
- func (svc *Mock) MockBulkDelete(...) *Mock
- func (svc *Mock) MockBulkLoad(...) *Mock
- func (svc *Mock) MockBulkReserve(...) *Mock
- func (svc *Mock) MockBulkRevise(...) *Mock
- func (svc *Mock) MockBulkStore(...) *Mock
- func (svc *Mock) MockCount(...) *Mock
- func (svc *Mock) MockCreate(...) *Mock
- func (svc *Mock) MockCreateREST(...) *Mock
- func (svc *Mock) MockDelete(...) *Mock
- func (svc *Mock) MockDeleteREST(...) *Mock
- func (svc *Mock) MockDemo(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
- func (svc *Mock) MockList(...) *Mock
- func (svc *Mock) MockListREST(...) *Mock
- func (svc *Mock) MockLoad(...) *Mock
- func (svc *Mock) MockLoadREST(...) *Mock
- func (svc *Mock) MockLookup(...) *Mock
- func (svc *Mock) MockMustDelete(handler func(ctx context.Context, objKey yellowpagesapi.PersonKey) (err error)) *Mock
- func (svc *Mock) MockMustLoad(...) *Mock
- func (svc *Mock) MockMustLookup(...) *Mock
- func (svc *Mock) MockMustRevise(handler func(ctx context.Context, obj *yellowpagesapi.Person) (err error)) *Mock
- func (svc *Mock) MockMustStore(handler func(ctx context.Context, obj *yellowpagesapi.Person) (err error)) *Mock
- func (svc *Mock) MockPurge(...) *Mock
- func (svc *Mock) MockReserve(...) *Mock
- func (svc *Mock) MockRevise(...) *Mock
- func (svc *Mock) MockStore(...) *Mock
- func (svc *Mock) MockStoreREST(...) *Mock
- func (svc *Mock) MockTryBulkReserve(...) *Mock
- func (svc *Mock) MockTryReserve(...) *Mock
- func (svc *Mock) MustDelete(ctx context.Context, objKey yellowpagesapi.PersonKey) (err error)
- func (svc *Mock) MustLoad(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, err error)
- func (svc *Mock) MustLookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, err error)
- func (svc *Mock) MustRevise(ctx context.Context, obj *yellowpagesapi.Person) (err error)
- func (svc *Mock) MustStore(ctx context.Context, obj *yellowpagesapi.Person) (err error)
- func (svc *Mock) OnShutdown(ctx context.Context) (err error)
- func (svc *Mock) OnStartup(ctx context.Context) (err error)
- func (svc *Mock) Purge(ctx context.Context, query yellowpagesapi.Query) (deletedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Mock) Reserve(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error)
- func (svc *Mock) Revise(ctx context.Context, obj *yellowpagesapi.Person) (revised bool, err error)
- func (svc *Mock) Store(ctx context.Context, obj *yellowpagesapi.Person) (stored bool, err error)
- func (svc *Mock) StoreREST(ctx context.Context, key yellowpagesapi.PersonKey, ...) (httpStatusCode int, err error)
- func (svc *Mock) TryBulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Mock) TryReserve(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error)
- type Service
- func (svc *Service) BulkCreate(ctx context.Context, objs []*yellowpagesapi.Person) (objKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Service) BulkDelete(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (deletedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Service) BulkLoad(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (objs []*yellowpagesapi.Person, err error)
- func (svc *Service) BulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Service) BulkRevise(ctx context.Context, objs []*yellowpagesapi.Person) (revisedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Service) BulkStore(ctx context.Context, objs []*yellowpagesapi.Person) (storedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Service) Count(ctx context.Context, query yellowpagesapi.Query) (count int, err error)
- func (svc *Service) Create(ctx context.Context, obj *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, err error)
- func (svc *Service) CreateREST(ctx context.Context, httpRequestBody *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, httpStatusCode int, err error)
- func (svc *Service) Delete(ctx context.Context, objKey yellowpagesapi.PersonKey) (deleted bool, err error)
- func (svc *Service) DeleteREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpStatusCode int, err error)
- func (svc *Service) Demo(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) Init(initializer func(svc *Service) (err error)) *Service
- func (svc *Service) List(ctx context.Context, query yellowpagesapi.Query) (objs []*yellowpagesapi.Person, totalCount int, err error)
- func (svc *Service) ListREST(ctx context.Context, q yellowpagesapi.Query) (httpResponseBody []*yellowpagesapi.Person, httpStatusCode int, err error)
- func (svc *Service) Load(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, found bool, err error)
- func (svc *Service) LoadREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpResponseBody *yellowpagesapi.Person, httpStatusCode int, err error)
- func (svc *Service) Lookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, found bool, err error)
- func (svc *Service) MustDelete(ctx context.Context, objKey yellowpagesapi.PersonKey) (err error)
- func (svc *Service) MustLoad(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, err error)
- func (svc *Service) MustLookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, err error)
- func (svc *Service) MustRevise(ctx context.Context, obj *yellowpagesapi.Person) (err error)
- func (svc *Service) MustStore(ctx context.Context, obj *yellowpagesapi.Person) (err error)
- func (svc *Service) OnShutdown(ctx context.Context) (err error)
- func (svc *Service) OnStartup(ctx context.Context) (err error)
- func (svc *Service) Purge(ctx context.Context, query yellowpagesapi.Query) (deletedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Service) Reserve(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error)
- func (svc *Service) Revise(ctx context.Context, obj *yellowpagesapi.Person) (revised bool, err error)
- func (svc *Service) Store(ctx context.Context, obj *yellowpagesapi.Person) (stored bool, err error)
- func (svc *Service) StoreREST(ctx context.Context, key yellowpagesapi.PersonKey, ...) (httpStatusCode int, err error)
- func (svc *Service) TryBulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)
- func (svc *Service) TryReserve(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error)
- type ToDo
Constants ¶
const ( Hostname = yellowpagesapi.Hostname Version = 10 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intermediate ¶
Intermediate extends and customizes the generic base connector.
func NewIntermediate ¶
func NewIntermediate(impl ToDo) *Intermediate
NewIntermediate creates a new instance of the intermediate.
func (*Intermediate) SQLDataSourceName ¶
func (svc *Intermediate) SQLDataSourceName() (value string)
SQLDataSourceName is the connection string of the SQL database.
func (*Intermediate) SetSQLDataSourceName ¶
func (svc *Intermediate) SetSQLDataSourceName(value string) (err error)
SetSQLDataSourceName sets the value of the configuration property.
type Mock ¶
type Mock struct {
*Intermediate
// contains filtered or unexported fields
}
Mock is a mockable version of the microservice, allowing functions, event sinks and web handlers to be mocked.
func (*Mock) BulkCreate ¶
func (svc *Mock) BulkCreate(ctx context.Context, objs []*yellowpagesapi.Person) (objKeys []yellowpagesapi.PersonKey, err error)
BulkCreate executes the mock handler.
func (*Mock) BulkDelete ¶
func (svc *Mock) BulkDelete(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (deletedKeys []yellowpagesapi.PersonKey, err error)
BulkDelete executes the mock handler.
func (*Mock) BulkLoad ¶
func (svc *Mock) BulkLoad(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (objs []*yellowpagesapi.Person, err error)
BulkLoad executes the mock handler.
func (*Mock) BulkReserve ¶ added in v1.26.0
func (svc *Mock) BulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)
BulkReserve executes the mock handler.
func (*Mock) BulkRevise ¶
func (svc *Mock) BulkRevise(ctx context.Context, objs []*yellowpagesapi.Person) (revisedKeys []yellowpagesapi.PersonKey, err error)
BulkRevise executes the mock handler.
func (*Mock) BulkStore ¶
func (svc *Mock) BulkStore(ctx context.Context, objs []*yellowpagesapi.Person) (storedKeys []yellowpagesapi.PersonKey, err error)
BulkStore executes the mock handler.
func (*Mock) Create ¶
func (svc *Mock) Create(ctx context.Context, obj *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, err error)
Create executes the mock handler.
func (*Mock) CreateREST ¶
func (svc *Mock) CreateREST(ctx context.Context, httpRequestBody *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, httpStatusCode int, err error)
CreateREST executes the mock handler.
func (*Mock) Delete ¶
func (svc *Mock) Delete(ctx context.Context, objKey yellowpagesapi.PersonKey) (deleted bool, err error)
Delete executes the mock handler.
func (*Mock) DeleteREST ¶
func (svc *Mock) DeleteREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpStatusCode int, err error)
DeleteREST executes the mock handler.
func (*Mock) List ¶
func (svc *Mock) List(ctx context.Context, query yellowpagesapi.Query) (objs []*yellowpagesapi.Person, totalCount int, err error)
List executes the mock handler.
func (*Mock) ListREST ¶
func (svc *Mock) ListREST(ctx context.Context, q yellowpagesapi.Query) (httpResponseBody []*yellowpagesapi.Person, httpStatusCode int, err error)
ListREST executes the mock handler.
func (*Mock) Load ¶
func (svc *Mock) Load(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, found bool, err error)
Load executes the mock handler.
func (*Mock) LoadREST ¶
func (svc *Mock) LoadREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpResponseBody *yellowpagesapi.Person, httpStatusCode int, err error)
LoadREST executes the mock handler.
func (*Mock) Lookup ¶
func (svc *Mock) Lookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, found bool, err error)
Lookup executes the mock handler.
func (*Mock) MockBulkCreate ¶
func (svc *Mock) MockBulkCreate(handler func(ctx context.Context, objs []*yellowpagesapi.Person) (objKeys []yellowpagesapi.PersonKey, err error)) *Mock
MockBulkCreate sets up a mock handler for BulkCreate.
func (*Mock) MockBulkDelete ¶
func (svc *Mock) MockBulkDelete(handler func(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (deletedKeys []yellowpagesapi.PersonKey, err error)) *Mock
MockBulkDelete sets up a mock handler for BulkDelete.
func (*Mock) MockBulkLoad ¶
func (svc *Mock) MockBulkLoad(handler func(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (objs []*yellowpagesapi.Person, err error)) *Mock
MockBulkLoad sets up a mock handler for BulkLoad.
func (*Mock) MockBulkReserve ¶ added in v1.26.0
func (svc *Mock) MockBulkReserve(handler func(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)) *Mock
MockBulkReserve sets up a mock handler for BulkReserve.
func (*Mock) MockBulkRevise ¶
func (svc *Mock) MockBulkRevise(handler func(ctx context.Context, objs []*yellowpagesapi.Person) (revisedKeys []yellowpagesapi.PersonKey, err error)) *Mock
MockBulkRevise sets up a mock handler for BulkRevise.
func (*Mock) MockBulkStore ¶
func (svc *Mock) MockBulkStore(handler func(ctx context.Context, objs []*yellowpagesapi.Person) (storedKeys []yellowpagesapi.PersonKey, err error)) *Mock
MockBulkStore sets up a mock handler for BulkStore.
func (*Mock) MockCount ¶
func (svc *Mock) MockCount(handler func(ctx context.Context, query yellowpagesapi.Query) (count int, err error)) *Mock
MockCount sets up a mock handler for Count.
func (*Mock) MockCreate ¶
func (svc *Mock) MockCreate(handler func(ctx context.Context, obj *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, err error)) *Mock
MockCreate sets up a mock handler for Create.
func (*Mock) MockCreateREST ¶
func (svc *Mock) MockCreateREST(handler func(ctx context.Context, httpRequestBody *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, httpStatusCode int, err error)) *Mock
MockCreateREST sets up a mock handler for CreateREST.
func (*Mock) MockDelete ¶
func (svc *Mock) MockDelete(handler func(ctx context.Context, objKey yellowpagesapi.PersonKey) (deleted bool, err error)) *Mock
MockDelete sets up a mock handler for Delete.
func (*Mock) MockDeleteREST ¶
func (svc *Mock) MockDeleteREST(handler func(ctx context.Context, key yellowpagesapi.PersonKey) (httpStatusCode int, err error)) *Mock
MockDeleteREST sets up a mock handler for DeleteREST.
func (*Mock) MockList ¶
func (svc *Mock) MockList(handler func(ctx context.Context, query yellowpagesapi.Query) (objs []*yellowpagesapi.Person, totalCount int, err error)) *Mock
MockList sets up a mock handler for List.
func (*Mock) MockListREST ¶
func (svc *Mock) MockListREST(handler func(ctx context.Context, q yellowpagesapi.Query) (httpResponseBody []*yellowpagesapi.Person, httpStatusCode int, err error)) *Mock
MockListREST sets up a mock handler for ListREST.
func (*Mock) MockLoad ¶
func (svc *Mock) MockLoad(handler func(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, found bool, err error)) *Mock
MockLoad sets up a mock handler for Load.
func (*Mock) MockLoadREST ¶
func (svc *Mock) MockLoadREST(handler func(ctx context.Context, key yellowpagesapi.PersonKey) (httpResponseBody *yellowpagesapi.Person, httpStatusCode int, err error)) *Mock
MockLoadREST sets up a mock handler for LoadREST.
func (*Mock) MockLookup ¶
func (svc *Mock) MockLookup(handler func(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, found bool, err error)) *Mock
MockLookup sets up a mock handler for Lookup.
func (*Mock) MockMustDelete ¶
func (svc *Mock) MockMustDelete(handler func(ctx context.Context, objKey yellowpagesapi.PersonKey) (err error)) *Mock
MockMustDelete sets up a mock handler for MustDelete.
func (*Mock) MockMustLoad ¶
func (svc *Mock) MockMustLoad(handler func(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, err error)) *Mock
MockMustLoad sets up a mock handler for MustLoad.
func (*Mock) MockMustLookup ¶
func (svc *Mock) MockMustLookup(handler func(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, err error)) *Mock
MockMustLookup sets up a mock handler for MustLookup.
func (*Mock) MockMustRevise ¶
func (svc *Mock) MockMustRevise(handler func(ctx context.Context, obj *yellowpagesapi.Person) (err error)) *Mock
MockMustRevise sets up a mock handler for MustRevise.
func (*Mock) MockMustStore ¶
func (svc *Mock) MockMustStore(handler func(ctx context.Context, obj *yellowpagesapi.Person) (err error)) *Mock
MockMustStore sets up a mock handler for MustStore.
func (*Mock) MockPurge ¶
func (svc *Mock) MockPurge(handler func(ctx context.Context, query yellowpagesapi.Query) (deletedKeys []yellowpagesapi.PersonKey, err error)) *Mock
MockPurge sets up a mock handler for Purge.
func (*Mock) MockReserve ¶ added in v1.26.0
func (svc *Mock) MockReserve(handler func(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error)) *Mock
MockReserve sets up a mock handler for Reserve.
func (*Mock) MockRevise ¶
func (svc *Mock) MockRevise(handler func(ctx context.Context, obj *yellowpagesapi.Person) (revised bool, err error)) *Mock
MockRevise sets up a mock handler for Revise.
func (*Mock) MockStore ¶
func (svc *Mock) MockStore(handler func(ctx context.Context, obj *yellowpagesapi.Person) (stored bool, err error)) *Mock
MockStore sets up a mock handler for Store.
func (*Mock) MockStoreREST ¶
func (svc *Mock) MockStoreREST(handler func(ctx context.Context, key yellowpagesapi.PersonKey, httpRequestBody *yellowpagesapi.Person) (httpStatusCode int, err error)) *Mock
MockStoreREST sets up a mock handler for StoreREST.
func (*Mock) MockTryBulkReserve ¶ added in v1.26.0
func (svc *Mock) MockTryBulkReserve(handler func(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)) *Mock
MockTryBulkReserve sets up a mock handler for TryBulkReserve.
func (*Mock) MockTryReserve ¶ added in v1.26.0
func (svc *Mock) MockTryReserve(handler func(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error)) *Mock
MockTryReserve sets up a mock handler for TryReserve.
func (*Mock) MustDelete ¶
MustDelete executes the mock handler.
func (*Mock) MustLoad ¶
func (svc *Mock) MustLoad(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, err error)
MustLoad executes the mock handler.
func (*Mock) MustLookup ¶
func (svc *Mock) MustLookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, err error)
MustLookup executes the mock handler.
func (*Mock) MustRevise ¶
MustRevise executes the mock handler.
func (*Mock) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
func (*Mock) Purge ¶
func (svc *Mock) Purge(ctx context.Context, query yellowpagesapi.Query) (deletedKeys []yellowpagesapi.PersonKey, err error)
Purge executes the mock handler.
func (*Mock) Reserve ¶ added in v1.26.0
func (svc *Mock) Reserve(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error)
Reserve executes the mock handler.
func (*Mock) StoreREST ¶
func (svc *Mock) StoreREST(ctx context.Context, key yellowpagesapi.PersonKey, httpRequestBody *yellowpagesapi.Person) (httpStatusCode int, err error)
StoreREST executes the mock handler.
func (*Mock) TryBulkReserve ¶ added in v1.26.0
func (svc *Mock) TryBulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)
TryBulkReserve executes the mock handler.
type Service ¶
type Service struct {
*Intermediate // IMPORTANT: Do not remove
// contains filtered or unexported fields
}
Service implements the microservice which persists persons in a SQL database.
func (*Service) BulkCreate ¶
func (svc *Service) BulkCreate(ctx context.Context, objs []*yellowpagesapi.Person) (objKeys []yellowpagesapi.PersonKey, err error)
BulkCreate creates multiple objects, returning their keys.
func (*Service) BulkDelete ¶
func (svc *Service) BulkDelete(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (deletedKeys []yellowpagesapi.PersonKey, err error)
BulkDelete deletes the objects matching the keys, returning the keys of the deleted objects.
func (*Service) BulkLoad ¶
func (svc *Service) BulkLoad(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (objs []*yellowpagesapi.Person, err error)
BulkLoad returns the objects matching the keys.
func (*Service) BulkReserve ¶ added in v1.26.0
func (svc *Service) BulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)
BulkReserve unconditionally reserves persons for the given duration, returning the keys of those that exist.
func (*Service) BulkRevise ¶
func (svc *Service) BulkRevise(ctx context.Context, objs []*yellowpagesapi.Person) (revisedKeys []yellowpagesapi.PersonKey, err error)
BulkRevise updates multiple objects, returning the number of rows affected. Only rows with matching revisions are updated.
func (*Service) BulkStore ¶
func (svc *Service) BulkStore(ctx context.Context, objs []*yellowpagesapi.Person) (storedKeys []yellowpagesapi.PersonKey, err error)
BulkStore updates multiple objects, returning the keys of the stored objects.
func (*Service) Count ¶
Count returns the number of objects matching the query, disregarding pagination.
func (*Service) Create ¶
func (svc *Service) Create(ctx context.Context, obj *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, err error)
Create creates a new object, returning its key.
func (*Service) CreateREST ¶
func (svc *Service) CreateREST(ctx context.Context, httpRequestBody *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, httpStatusCode int, err error)
CreateREST creates a new person via REST, returning its key.
func (*Service) Delete ¶
func (svc *Service) Delete(ctx context.Context, objKey yellowpagesapi.PersonKey) (deleted bool, err error)
Delete deletes the object.
func (*Service) DeleteREST ¶
func (svc *Service) DeleteREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpStatusCode int, err error)
DeleteREST deletes an existing person via REST.
func (*Service) List ¶
func (svc *Service) List(ctx context.Context, query yellowpagesapi.Query) (objs []*yellowpagesapi.Person, totalCount int, err error)
List returns the objects matching the query, and the total count of matches regardless of the limit.
func (*Service) ListREST ¶
func (svc *Service) ListREST(ctx context.Context, q yellowpagesapi.Query) (httpResponseBody []*yellowpagesapi.Person, httpStatusCode int, err error)
ListREST lists persons matching the query via REST.
func (*Service) Load ¶
func (svc *Service) Load(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, found bool, err error)
Load returns the object associated with the key.
func (*Service) LoadREST ¶
func (svc *Service) LoadREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpResponseBody *yellowpagesapi.Person, httpStatusCode int, err error)
LoadREST loads a person by key via REST.
func (*Service) Lookup ¶
func (svc *Service) Lookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, found bool, err error)
Lookup returns the single object matching the query. It errors if more than one object matches the query.
func (*Service) MustDelete ¶
MustDelete deletes the object.
func (*Service) MustLoad ¶
func (svc *Service) MustLoad(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, err error)
MustLoad returns the object associated with the key. It errors if the object is not found.
func (*Service) MustLookup ¶
func (svc *Service) MustLookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, err error)
MustLookup returns the single object matching the query. It errors unless exactly one object matches the query.
func (*Service) MustRevise ¶
MustRevise updates the object only if the revision matches.
func (*Service) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
func (*Service) Purge ¶
func (svc *Service) Purge(ctx context.Context, query yellowpagesapi.Query) (deletedKeys []yellowpagesapi.PersonKey, err error)
Purge deletes all objects matching the query, returning the keys of the deleted objects.
func (*Service) Reserve ¶ added in v1.26.0
func (svc *Service) Reserve(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error)
Reserve unconditionally reserves a person for the given duration, returning true if the person exists.
func (*Service) Revise ¶
func (svc *Service) Revise(ctx context.Context, obj *yellowpagesapi.Person) (revised bool, err error)
Revise updates the object only if the revision matches.
func (*Service) StoreREST ¶
func (svc *Service) StoreREST(ctx context.Context, key yellowpagesapi.PersonKey, httpRequestBody *yellowpagesapi.Person) (httpStatusCode int, err error)
StoreREST updates an existing person via REST.
func (*Service) TryBulkReserve ¶ added in v1.26.0
func (svc *Service) TryBulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error)
TryBulkReserve attempts to reserve persons for the given duration, returning the keys of those successfully reserved. Only persons whose reservation has expired (reserved_before < NOW) are reserved.
type ToDo ¶
type ToDo interface {
OnStartup(ctx context.Context) (err error)
OnShutdown(ctx context.Context) (err error)
Create(ctx context.Context, obj *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, err error) // MARKER: Create
Store(ctx context.Context, obj *yellowpagesapi.Person) (stored bool, err error) // MARKER: Store
MustStore(ctx context.Context, obj *yellowpagesapi.Person) (err error) // MARKER: MustStore
Revise(ctx context.Context, obj *yellowpagesapi.Person) (revised bool, err error) // MARKER: Revise
MustRevise(ctx context.Context, obj *yellowpagesapi.Person) (err error) // MARKER: MustRevise
Delete(ctx context.Context, objKey yellowpagesapi.PersonKey) (deleted bool, err error) // MARKER: Delete
MustDelete(ctx context.Context, objKey yellowpagesapi.PersonKey) (err error) // MARKER: MustDelete
List(ctx context.Context, query yellowpagesapi.Query) (objs []*yellowpagesapi.Person, totalCount int, err error) // MARKER: List
Lookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, found bool, err error) // MARKER: Lookup
MustLookup(ctx context.Context, query yellowpagesapi.Query) (obj *yellowpagesapi.Person, err error) // MARKER: MustLookup
Load(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, found bool, err error) // MARKER: Load
MustLoad(ctx context.Context, objKey yellowpagesapi.PersonKey) (obj *yellowpagesapi.Person, err error) // MARKER: MustLoad
BulkLoad(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (objs []*yellowpagesapi.Person, err error) // MARKER: BulkLoad
BulkDelete(ctx context.Context, objKeys []yellowpagesapi.PersonKey) (deletedKeys []yellowpagesapi.PersonKey, err error) // MARKER: BulkDelete
BulkCreate(ctx context.Context, objs []*yellowpagesapi.Person) (objKeys []yellowpagesapi.PersonKey, err error) // MARKER: BulkCreate
BulkStore(ctx context.Context, objs []*yellowpagesapi.Person) (storedKeys []yellowpagesapi.PersonKey, err error) // MARKER: BulkStore
BulkRevise(ctx context.Context, objs []*yellowpagesapi.Person) (revisedKeys []yellowpagesapi.PersonKey, err error) // MARKER: BulkRevise
Purge(ctx context.Context, query yellowpagesapi.Query) (deletedKeys []yellowpagesapi.PersonKey, err error) // MARKER: Purge
Count(ctx context.Context, query yellowpagesapi.Query) (count int, err error) // MARKER: Count
CreateREST(ctx context.Context, httpRequestBody *yellowpagesapi.Person) (objKey yellowpagesapi.PersonKey, httpStatusCode int, err error) // MARKER: CreateREST
StoreREST(ctx context.Context, key yellowpagesapi.PersonKey, httpRequestBody *yellowpagesapi.Person) (httpStatusCode int, err error) // MARKER: StoreREST
DeleteREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpStatusCode int, err error) // MARKER: DeleteREST
LoadREST(ctx context.Context, key yellowpagesapi.PersonKey) (httpResponseBody *yellowpagesapi.Person, httpStatusCode int, err error) // MARKER: LoadREST
ListREST(ctx context.Context, q yellowpagesapi.Query) (httpResponseBody []*yellowpagesapi.Person, httpStatusCode int, err error) // MARKER: ListREST
TryReserve(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error) // MARKER: TryReserve
TryBulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error) // MARKER: TryBulkReserve
Reserve(ctx context.Context, objKey yellowpagesapi.PersonKey, dur time.Duration) (reserved bool, err error) // MARKER: Reserve
BulkReserve(ctx context.Context, objKeys []yellowpagesapi.PersonKey, dur time.Duration) (reservedKeys []yellowpagesapi.PersonKey, err error) // MARKER: BulkReserve
Demo(w http.ResponseWriter, r *http.Request) (err error) // MARKER: Demo
}
ToDo is implemented by the service or mock. The intermediate delegates handling to this interface.