Documentation ¶
Overview ¶
Package intermediate serves as the foundation of the eventsink.example microservice.
The event sink microservice handles events that are fired by the event source microservice.
Index ¶
- type Intermediate
- type Mock
- func (svc *Mock) MockOnAllowRegister(handler func(ctx context.Context, email string) (allow bool, err error)) *Mock
- func (svc *Mock) MockOnRegistered(handler func(ctx context.Context, email string) (err error)) *Mock
- func (svc *Mock) MockRegistered(handler func(ctx context.Context) (emails []string, err error)) *Mock
- func (svc *Mock) OnAllowRegister(ctx context.Context, email string) (allow bool, err error)
- func (svc *Mock) OnRegistered(ctx context.Context, email string) (err error)
- func (svc *Mock) OnShutdown(ctx context.Context) (err error)
- func (svc *Mock) OnStartup(ctx context.Context) (err error)
- func (svc *Mock) Registered(ctx context.Context) (emails []string, err error)
- type ToDo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intermediate ¶
Intermediate extends and customizes the generic base connector. Code generated microservices then extend the intermediate.
func NewService ¶
func NewService(impl ToDo, version int) *Intermediate
NewService creates a new intermediate service.
type Mock ¶
type Mock struct { *Intermediate // contains filtered or unexported fields }
Mock is a mockable version of the eventsink.example microservice, allowing functions, event sinks and web handlers to be mocked.
func (*Mock) MockOnAllowRegister ¶
func (svc *Mock) MockOnAllowRegister(handler func(ctx context.Context, email string) (allow bool, err error)) *Mock
MockOnAllowRegister sets up a mock handler for the OnAllowRegister endpoint.
func (*Mock) MockOnRegistered ¶
func (svc *Mock) MockOnRegistered(handler func(ctx context.Context, email string) (err error)) *Mock
MockOnRegistered sets up a mock handler for the OnRegistered endpoint.
func (*Mock) MockRegistered ¶
func (svc *Mock) MockRegistered(handler func(ctx context.Context) (emails []string, err error)) *Mock
MockRegistered sets up a mock handler for the Registered endpoint.
func (*Mock) OnAllowRegister ¶
OnAllowRegister runs the mock handler set by MockOnAllowRegister.
func (*Mock) OnRegistered ¶
OnRegistered runs the mock handler set by MockOnRegistered.
func (*Mock) OnShutdown ¶
OnShutdown is a no op.
type ToDo ¶
type ToDo interface { OnStartup(ctx context.Context) (err error) OnShutdown(ctx context.Context) (err error) Registered(ctx context.Context) (emails []string, err error) OnAllowRegister(ctx context.Context, email string) (allow bool, err error) OnRegistered(ctx context.Context, email string) (err error) }
ToDo defines the interface that the microservice must implement. The intermediate delegates handling to this interface.