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

Method Wrap

middleware/route_injector.go:21–26  ·  view source on GitHub ↗
(handler http.Handler)

Source from the content-addressed store, hash-verified

19}
20
21func (i RouteInjector) Wrap(handler http.Handler) http.Handler {
22 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
23 routeName := getRouteName(i.RouteMatcher, r)
24 handler.ServeHTTP(w, WithRouteName(r, routeName))
25 })
26}
27
28// WithRouteName annotates r's context with the provided route name.
29//

Callers

nothing calls this directly

Calls 3

getRouteNameFunction · 0.85
WithRouteNameFunction · 0.85
ServeHTTPMethod · 0.45

Tested by

no test coverage detected