MCPcopy
hub / github.com/esm-dev/esm.sh / pprofRouter

Function pprofRouter

server/debug.go:25–43  ·  view source on GitHub ↗

pprof middleware

()

Source from the content-addressed store, hash-verified

23
24// pprof middleware
25func pprofRouter() rex.Handle {
26 return func(ctx *rex.Context) any {
27 switch ctx.R.URL.Path {
28 case "/debug/pprof/cmdline":
29 return http.HandlerFunc(pprof.Cmdline)
30 case "/debug/pprof/profile":
31 return http.HandlerFunc(pprof.Profile)
32 case "/debug/pprof/symbol":
33 return http.HandlerFunc(pprof.Symbol)
34 case "/debug/pprof/trace":
35 return http.HandlerFunc(pprof.Trace)
36 default:
37 if strings.HasPrefix(ctx.R.URL.Path, "/debug/pprof/") {
38 return http.HandlerFunc(pprof.Index)
39 }
40 return rex.Next()
41 }
42 }
43}
44
45type MockEmbedFS struct{}
46

Callers 1

StartFunction · 0.70

Calls 1

NextMethod · 0.80

Tested by

no test coverage detected