chi

package
v0.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

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

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

Functions

func DefaultContextExtractor

func DefaultContextExtractor(_ any) []hyperlogger.Field

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

func Middleware

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

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

Types

type Config

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

Config defines the configuration options for the Chi middleware.

Jump to

Keyboard shortcuts

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