middleware

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: MIT Imports: 10 Imported by: 0

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 CORS

func CORS(h http.Handler) http.Handler

CORS is a middleware function that manages cross-origin requests.

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.

Jump to

Keyboard shortcuts

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