Documentation ¶
Overview ¶
Package middleware contains mux.MiddlewareFunc implementations that are used as HTTP router middlewares.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Metrics ¶
func Metrics() mux.MiddlewareFunc
Metrics is a middleware function that manipulates prometheus metrics for requests it handles.
func Monitoring ¶
func Monitoring() mux.MiddlewareFunc
Monitoring is an HTTP middleware that will write panics to the application monitoring provider.
func Panic ¶
func Panic() mux.MiddlewareFunc
Panic is a middleware function that handles runtime panics spawning from HTTP requests. If a panic occurs, the goroutine is recovered and an internal server error is written to the client.
func RequestID ¶
func RequestID() mux.MiddlewareFunc
RequestID is a middleware that reuses or creates a request id for each HTTP request. The id is also added to the request context using the requestid package.
func Security ¶
func Security(enabled bool) mux.MiddlewareFunc
Security is an HTTP middleware that applies HTTP security features to inbound requests. If 'enabled' is false, SSL features are disabled.
func Tracing ¶
func Tracing() mux.MiddlewareFunc
Tracing returns a middleware function that adds opentracing to inbound HTTP requests. It will also add request ids and user identifiers to the span tags.
Types ¶
This section is empty.