Documentation
¶
Overview ¶
Package pprof registers Go pprof handlers on an HTTP router.
RegisterRoutes wires profiling handlers only; it does not add authentication, authorization, or network restrictions. Prefer RegisterAdminRoutes for new admin mounts so an explicit wrapper is required at construction time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterAdminRoutes ¶ added in v2.1.0
RegisterAdminRoutes wires pprof handlers behind an explicit authorization or internal-network wrapper. Passing nil fails closed so admin-only mounts cannot accidentally expose pprof without policy.
func RegisterRoutes ¶
func RegisterRoutes(r Router)
RegisterRoutes wires the default pprof handlers on the provided router. Deprecated: prefer RegisterAdminRoutes for new admin mounts so an explicit authorization or internal-network wrapper is required.
Types ¶
type Router ¶
type Router interface {
Get(pattern string, h http.HandlerFunc)
}
Router defines the minimal GET registration contract needed for pprof routes.