Documentation ¶
Overview ¶
Package intermediate serves as the foundation of the configurator.core microservice.
The Configurator is a core microservice that centralizes the dissemination of configuration values to other microservices.
Index ¶
- type Intermediate
- type Mock
- func (svc *Mock) MockRefresh(handler func(ctx context.Context) (err error)) *Mock
- func (svc *Mock) MockSync(...) *Mock
- func (svc *Mock) MockValues(...) *Mock
- func (svc *Mock) OnShutdown(ctx context.Context) (err error)
- func (svc *Mock) OnStartup(ctx context.Context) (err error)
- func (svc *Mock) PeriodicRefresh(ctx context.Context) (err error)
- func (svc *Mock) Refresh(ctx context.Context) (err error)
- func (svc *Mock) Sync(ctx context.Context, timestamp time.Time, values map[string]map[string]string) (err error)
- func (svc *Mock) Values(ctx context.Context, names []string) (values map[string]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 configurator.core microservice, allowing functions, event sinks and web handlers to be mocked.
func (*Mock) MockRefresh ¶
MockRefresh sets up a mock handler for the Refresh endpoint.
func (*Mock) MockSync ¶
func (svc *Mock) MockSync(handler func(ctx context.Context, timestamp time.Time, values map[string]map[string]string) (err error)) *Mock
MockSync sets up a mock handler for the Sync endpoint.
func (*Mock) MockValues ¶
func (svc *Mock) MockValues(handler func(ctx context.Context, names []string) (values map[string]string, err error)) *Mock
MockValues sets up a mock handler for the Values 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.
func (*Mock) PeriodicRefresh ¶
PeriodicRefresh is a no op.
type ToDo ¶
type ToDo interface { OnStartup(ctx context.Context) (err error) OnShutdown(ctx context.Context) (err error) Values(ctx context.Context, names []string) (values map[string]string, err error) Refresh(ctx context.Context) (err error) Sync(ctx context.Context, timestamp time.Time, values map[string]map[string]string) (err error) PeriodicRefresh(ctx context.Context) (err error) }
ToDo defines the interface that the microservice must implement. The intermediate delegates handling to this interface.