gin

package module
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 7 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL