Documentation
¶
Index ¶
- Constants
- type Intermediate
- type Mock
- func (svc *Mock) MockRegister(handler func(ctx context.Context, email string) (allowed bool, err error)) *Mock
- func (svc *Mock) OnShutdown(ctx context.Context) (err error)
- func (svc *Mock) OnStartup(ctx context.Context) (err error)
- func (svc *Mock) Register(ctx context.Context, email string) (allowed bool, err error)
- type Service
- type ToDo
Constants ¶
View Source
const ( Hostname = eventsourceapi.Hostname Version = eventsourceapi.Version Description = eventsourceapi.Description )
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.
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) MockRegister ¶
func (svc *Mock) MockRegister(handler func(ctx context.Context, email string) (allowed bool, err error)) *Mock
MockRegister sets up a mock handler for Register.
func (*Mock) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
type Service ¶
type Service struct {
*Intermediate // IMPORTANT: Do not remove
}
Service implements the eventsource.example microservice.
The event source microservice fires events that are caught by the event sink microservice.
func (*Service) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
type ToDo ¶
type ToDo interface {
OnStartup(ctx context.Context) (err error)
OnShutdown(ctx context.Context) (err error)
Register(ctx context.Context, email string) (allowed bool, err error) // MARKER: Register
}
ToDo is implemented by the service or mock. The intermediate delegates handling to this interface.
Click to show internal directories.
Click to hide internal directories.