middlewares

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LabeledMiddleware

type LabeledMiddleware func(string, endpoint.Endpoint) endpoint.Endpoint

LabeledMiddleware will get passed the endpoint name when passed to WrapAllLabeledExcept, this can be used to write a generic metrics middleware which can send the endpoint name to the metrics collector.

func ErrorCounter

func ErrorCounter(errCount metrics.Counter) LabeledMiddleware

ErrorCounter is a LabeledMiddleware, when applied with WrapAllLabeledExcept name will be populated with the endpoint name, and such this middleware will report errors to the metric provider with the endpoint name. Feel free to copy this example middleware to your service.

func Latency

Latency is a LabeledMiddleware, reporting the request time of and endpoint along with its name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL