Documentation
¶
Overview ¶
Package gin provides request and middleware profiling for Gin applications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware() gin.HandlerFunc
Middleware profiles Gin requests using the default profiler.
func MiddlewareWith ¶
func MiddlewareWith(p *webpprof.Profiler) gin.HandlerFunc
MiddlewareWith profiles Gin requests using p.
func ProfileMiddleware ¶
func ProfileMiddleware(name string, middleware gin.HandlerFunc) gin.HandlerFunc
ProfileMiddleware wraps a Gin middleware and records each invocation by name. Register Middleware before profiled middleware so entries are attached to the captured request.
func ProfileMiddlewareWith ¶
func ProfileMiddlewareWith(p *webpprof.Profiler, name string, middleware gin.HandlerFunc) gin.HandlerFunc
ProfileMiddlewareWith is ProfileMiddleware using an explicit profiler.
Types ¶
type ProfilerGin ¶
type ProfilerGin struct {
// contains filtered or unexported fields
}
ProfilerGin binds Gin middleware construction to a specific profiler.
func New ¶
func New(profiler *webpprof.Profiler) ProfilerGin
New creates a Gin integration bound to profiler. A nil profiler produces pass-through middleware.
func (ProfilerGin) Middleware ¶
func (p ProfilerGin) Middleware() gin.HandlerFunc
Middleware returns a Gin handler that records request, response, route, related operations, errors, and panics.