MCPcopy Create free account
hub / github.com/prometheus/common / WithPrefix

Method WithPrefix

route/route.go:66–68  ·  view source on GitHub ↗

WithPrefix returns a router that prefixes all registered routes with prefix.

(prefix string)

Source from the content-addressed store, hash-verified

64
65// WithPrefix returns a router that prefixes all registered routes with prefix.
66func (r *Router) WithPrefix(prefix string) *Router {
67 return &Router{rtr: r.rtr, prefix: r.prefix + prefix, instrh: r.instrh}
68}
69
70// handle turns a HandlerFunc into an httprouter.Handle.
71func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handle {

Callers 1

TestRedirectFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestRedirectFunction · 0.64