Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator interface {
AuthHandlers() (func(ctx context.Context, handlers map[string]interface{}) error, error)
}
Authenticator is a behavior that an HTTP authentication feature (plugin) must implement to be used inside the HTTP service implementation.
type Handler ¶
type Handler interface {
// Cors is a method that must return the CORS options for an HTTP server.
Cors() cors.Options
}
Handler is a behavior that an HTTP cors plugin must implement if one wants CORS implemented in the HTTP server.
type LoggerExtractor ¶
LoggerExtractor is an interface that a plugin can implement to provide an API allowing the service extract content from its context to add them into log messages.
type Recovery ¶
Recovery is a behavior that an HTTP panic recovery feature (plugin) must implement to be used inside the HTTP service implementation.
type Tracer ¶
type Tracer interface {
// StartMeasurements must retrieve required information from the current
// application context and initialize any internal information that will
// be used as metrics for it.
StartMeasurements(ctx context.Context, serviceType string) (interface{}, error)
// ComputeMetrics receives an updated context and data returned by the
// StartMeasurements method to compute the current application metrics.
ComputeMetrics(ctx context.Context, serviceType string, data interface{}) error
}
Tracer is an interface that a tracing feature plugin should implement to be used by all internal supported services.
type Tracker ¶
type Tracker interface {
// Generate is responsible for creating a new unique tracker ID.
Generate() string
// Add adds a tracker ID into the context and return a new one, updated.
Add(ctx context.Context, id string) context.Context
// Retrieve tries to retrieve the tracker ID from the current context and
// return it.
Retrieve(ctx context.Context) (string, bool)
}
Tracker is an interface that a plugin should implement to provide a way to add a unique tracing value in each call between services.