MCPcopy
hub / github.com/grafana/dskit / RouteInjector

Struct RouteInjector

middleware/route_injector.go:17–19  ·  view source on GitHub ↗

RouteInjector is a middleware that injects the route name for the current request into the request context. The route name can be retrieved by calling ExtractRouteName.

Source from the content-addressed store, hash-verified

15//
16// The route name can be retrieved by calling ExtractRouteName.
17type RouteInjector struct {
18 RouteMatcher RouteMatcher
19}
20
21func (i RouteInjector) Wrap(handler http.Handler) http.Handler {
22 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected