Documentation ¶
Overview ¶
Package intermediate serves as the foundation of the control.core microservice.
This microservice is created for the sake of generating the client API for the :888 control subscriptions. The microservice itself does nothing and should not be included in applications.
Index ¶
- type Intermediate
- type Mock
- func (svc *Mock) ConfigRefresh(ctx context.Context) (err error)
- func (svc *Mock) MockConfigRefresh(handler func(ctx context.Context) (err error)) *Mock
- func (svc *Mock) MockPing(handler func(ctx context.Context) (pong int, err error)) *Mock
- func (svc *Mock) MockTrace(handler func(ctx context.Context, id string) (err error)) *Mock
- func (svc *Mock) OnShutdown(ctx context.Context) (err error)
- func (svc *Mock) OnStartup(ctx context.Context) (err error)
- func (svc *Mock) Ping(ctx context.Context) (pong int, err error)
- func (svc *Mock) Trace(ctx context.Context, id 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 control.core microservice, allowing functions, event sinks and web handlers to be mocked.
func (*Mock) ConfigRefresh ¶
ConfigRefresh runs the mock handler set by MockConfigRefresh.
func (*Mock) MockConfigRefresh ¶
MockConfigRefresh sets up a mock handler for the ConfigRefresh endpoint.
func (*Mock) OnShutdown ¶
OnShutdown is a no op.
func (*Mock) OnStartup ¶
OnStartup makes sure that the mock is not executed in a non-dev environment.
type ToDo ¶
type ToDo interface { OnStartup(ctx context.Context) (err error) OnShutdown(ctx context.Context) (err error) Ping(ctx context.Context) (pong int, err error) ConfigRefresh(ctx context.Context) (err error) Trace(ctx context.Context, id string) (err error) }
ToDo defines the interface that the microservice must implement. The intermediate delegates handling to this interface.