Documentation
¶
Index ¶
Constants ¶
View Source
const ( RequestIDCtxKey = request(iota) RequestProtocolCtxKey RequestMethodCtxKey RequestPathCtxKey )
Variables ¶
This section is empty.
Functions ¶
func Request ¶ added in v0.0.23
Request is a server level middleware. It is called on every request to handle `X-Request-ID` header as well as the protocol, method and the URI. If the `X-Request-ID` header already exists in the request, nothing else is done otherwise a new UUID V4 format is generated and added to request `context`.
func Router ¶
func Router(h http.HandlerFunc, middleware ...rtr) http.HandlerFunc
Router allows router level middleware chaining. The first middleware in the chain runs last. Server level middleware always take precedence over router level middleware.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.