Documentation
¶
Index ¶
Constants ¶
const CtxRequestIDKey = ctxRequestID("request_id")
const CtxRouteNameKey = ctxRouteName("route_name")
Variables ¶
This section is empty.
Functions ¶
func RequestID ¶
RequestID is a server level middleware which creates a unique request identifier and links it to its corresponding key in the request context. If the `X-Request-ID` header already presents, its value is used instead. The purpose of this middleware is to inject the value to the logs.
func RequestIDFromContext ¶
RequestIDFromContext returns the current request identifier from the request context.
func RouteName ¶
RouteName is a route level middleware which names the given route and links it to its corresponding key in the request context. The purpose of this middleware is to inject the value to the logs.
func RouteNameFromContext ¶
RouteNameFromContext returns the name of the current route from the request context.
Types ¶
This section is empty.