Documentation
¶
Overview ¶
Package intermediate serves as the foundation of the metrics.core microservice.
The Metrics service is a core microservice that aggregates metrics from other microservices and makes them available for collection.
Index ¶
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.
func (*Intermediate) SecretKey ¶
func (svc *Intermediate) SecretKey() (secretKey string)
SecretKey must be provided with the request to collect the metrics. This key is required except in local development and tests.
func (*Intermediate) SetSecretKey ¶
func (svc *Intermediate) SetSecretKey(secretKey string) error
SetSecretKey sets the value of the configuration property.
SecretKey must be provided with the request to collect the metrics. This key is required except in local development and tests.
type Mock ¶
type Mock struct { *Intermediate // contains filtered or unexported fields }
Mock is a mockable version of the metrics.core microservice, allowing functions, event sinks and web handlers to be mocked.
func (*Mock) MockCollect ¶
func (svc *Mock) MockCollect(handler func(w http.ResponseWriter, r *http.Request) (err error)) *Mock
MockCollect sets up a mock handler for the Collect endpoint.
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) Collect(w http.ResponseWriter, r *http.Request) (err error) }
ToDo defines the interface that the microservice must implement. The intermediate delegates handling to this interface.