Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
func ObservabilityMiddleware ¶
func ObservabilityMiddleware(duration metrics.Histogram, logger log.Logger) Middleware
ObservabilityMiddleware implements both logging and prometheus metrics for each Service method
type Service ¶
type Service interface { // Divide two integers, a/b Divide(ctx context.Context, a, b float64) (float64, error) // Max two integers, returns the greater value of a and b Max(ctx context.Context, a, b float64) (float64, error) // Min two integers, returns the lesser value of a and b Min(ctx context.Context, a, b float64) (float64, error) // Multiply two integers, a*b Multiply(ctx context.Context, a, b float64) (float64, error) // Pow two integers, a^b Pow(ctx context.Context, a, b float64) (float64, error) // Subtract two integers, a-b Subtract(ctx context.Context, a, b float64) (float64, error) // Sums two integers. a+b Sum(ctx context.Context, a, b float64) (float64, error) }
Service describes a service that adds things together.
func NewBasicService ¶
func NewBasicService() Service
NewBasicService returns a naïve, stateless implementation of Service.
Click to show internal directories.
Click to hide internal directories.