middleware

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestIDCtxKey = request(iota)
	RequestProtocolCtxKey
	RequestMethodCtxKey
	RequestPathCtxKey
)
View Source
const RouteNameCtxKey = route(iota)

Variables

This section is empty.

Functions

func Request added in v0.0.23

func Request(h http.Handler) http.Handler

Request is a server level middleware. It is called on every request in order to add request specific values to the current context.

func RouteName added in v0.0.32

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

RouteName is a route level middleware. It helps assigning a name to the route within the current context.

func RouteNameFromRequest added in v0.0.32

func RouteNameFromRequest(r *http.Request) string

RouteNameFromRequest returns requested route's name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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