Documentation
¶
Index ¶
- Constants
- type Intermediate
- type Mock
- func (svc *Mock) ConfigRefresh(ctx context.Context) (err error)
- func (svc *Mock) Metrics(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Mock) MockConfigRefresh(handler func(ctx context.Context) (err error)) *Mock
- func (svc *Mock) MockMetrics(handler func(w http.ResponseWriter, r *http.Request) (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 Service
- func (svc *Service) ConfigRefresh(ctx context.Context) (err error)
- func (svc *Service) Init(initializer func(svc *Service) (err error)) *Service
- func (svc *Service) Metrics(w http.ResponseWriter, r *http.Request) (err error)
- func (svc *Service) OnShutdown(ctx context.Context) (err error)
- func (svc *Service) OnStartup(ctx context.Context) (err error)
- func (svc *Service) Ping(ctx context.Context) (pong int, err error)
- func (svc *Service) Trace(ctx context.Context, id string) (err error)
- type ToDo
Constants ¶
const ( Hostname = controlapi.Hostname Version = 235 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Intermediate ¶ added in v1.22.0
Intermediate extends and customizes the generic base connector.
func NewIntermediate ¶ added in v1.22.0
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) ConfigRefresh ¶ added in v1.22.0
ConfigRefresh executes the mock handler.
func (*Mock) MockConfigRefresh ¶ added in v1.22.0
MockConfigRefresh sets up a mock handler for ConfigRefresh.
func (*Mock) MockMetrics ¶ added in v1.22.0
func (svc *Mock) MockMetrics(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockMetrics sets up a mock handler for Metrics.
func (*Mock) OnShutdown ¶ added in v1.22.0
OnShutdown is called when the microservice is shut down.
type Service ¶
type Service struct {
*Intermediate // IMPORTANT: Do not remove
}
Service implements 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.
func (*Service) ConfigRefresh ¶
ConfigRefresh pulls the latest config values from the configurator microservice.
func (*Service) Metrics ¶ added in v1.19.0
Metrics returns the Prometheus metrics collected by the microservice.
func (*Service) OnShutdown ¶
OnShutdown is called when the microservice is shut down.
type ToDo ¶ added in v1.22.0
type ToDo interface {
OnStartup(ctx context.Context) (err error)
OnShutdown(ctx context.Context) (err error)
Ping(ctx context.Context) (pong int, err error) // MARKER: Ping
ConfigRefresh(ctx context.Context) (err error) // MARKER: ConfigRefresh
Trace(ctx context.Context, id string) (err error) // MARKER: Trace
Metrics(w http.ResponseWriter, r *http.Request) (err error) // MARKER: Metrics
}
ToDo is implemented by the service or mock. The intermediate delegates handling to this interface.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package controlapi implements the public API of the control.core microservice, including clients and data structures.
|
Package controlapi implements the public API of the control.core microservice, including clients and data structures. |