middlewares

package
v0.0.0-...-6a35e63 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LogMetricKeys = []string{"method", "route", "status_code"}
)

Functions

func PanicHandler

func PanicHandler(nextHandler http.Handler) http.Handler

PanicHandler will return statusCOde 500 and log panic error

func TraceRequest

func TraceRequest(nextHandler http.Handler) http.Handler

TraceRequest add X-Request-ID header to request

Types

type Middleware

type Middleware func(next http.Handler) http.Handler

func LogMetricRequest

func LogMetricRequest(latencyObserver metrics.Histogram) Middleware

LogRequest with info level every http request, unless production

type MiddlewareWithArgs

type MiddlewareWithArgs func(next http.Handler, args ...interface{}) http.Handler

Jump to

Keyboard shortcuts

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