gin

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIntegrationDisabled = ewrap.New("gin integration requires the 'gin_integration' build tag")

ErrIntegrationDisabled indicates that the gin middleware was built without gin support.

Functions

func DefaultContextExtractor

func DefaultContextExtractor(any) []hyperlogger.Field

DefaultContextExtractor is a no-op context extractor when gin integration is not enabled.

func Middleware

func Middleware(cfg Config) func(http.Handler) http.Handler

Middleware returns a stub gin middleware when the gin build tag is not provided.

func Recovery

func Recovery(cfg Config) func(http.Handler) http.Handler

Recovery returns a stub gin recovery middleware when the gin build tag is not provided.

Types

type Config

type Config struct {
	Logger           hyperlogger.Logger
	IncludeHeaders   []string
	ContextExtractor func(c any) []hyperlogger.Field
	CaptureRequestID bool
	LatencyFieldName string
	StatusFieldName  string
	EnableRecovery   bool
}

Config defines the configuration options for the Gin middleware.

Jump to

Keyboard shortcuts

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