middleware

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const CtxRequestIDKey = ctxRequestID(iota)
View Source
const CtxRouteNameKey = ctxRouteName(iota)

Variables

This section is empty.

Functions

func GetRequestID added in v0.0.33

func GetRequestID(ctx context.Context) string

GetRequestID returns the current request ID from the request context.

func GetRouteName added in v0.0.33

func GetRouteName(ctx context.Context) string

GetRouteName returns the current route's name from the request context.

func RequestID

func RequestID(h http.Handler) http.Handler

RequestID adds a request ID into the context of each request. If the `X-Request-ID` header exists, its value is used.

func RouteName added in v0.0.32

func RouteName(name string) func(next http.Handler) http.Handler

RouteName adds a route name into the context of each request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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