middleware

package
v0.30.0-dev Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExcludePath added in v0.28.0

func ExcludePath(path string)

ExcludePath adds a single path to the exclusion list for request logging

func ExcludePaths added in v0.28.0

func ExcludePaths(paths ...string)

ExcludePaths adds paths to the exclusion list for request logging

func LogRequests added in v0.3.0

func LogRequests(next http.Handler) http.Handler

LogRequests logs the incoming requests

func OtelMetrics

func OtelMetrics(provider *telemetry.Provider, telemetrySettings *settings.Telemetry) func(http.Handler) http.Handler

OtelMetrics returns middleware that collects HTTP metrics using OpenTelemetry. It returns a pass-through handler if telemetry is disabled for zero overhead.

func OtelTracing

func OtelTracing(provider *telemetry.Provider, telemetrySettings *settings.Telemetry) func(http.Handler) http.Handler

OtelTracing returns middleware that adds OpenTelemetry tracing to HTTP requests. It returns a pass-through handler if telemetry is disabled for zero overhead.

func PanicRecovery added in v0.3.0

func PanicRecovery(next http.Handler) http.Handler

func SetPathLogLevel added in v0.28.0

func SetPathLogLevel(path string, level slog.Level)

SetPathLogLevel sets the log level for a specific path other than the default info level

func TraceID added in v0.27.2

func TraceID(next http.Handler) http.Handler

Types

type Logger added in v0.6.0

type Logger struct {
	Logger *slog.Logger
}

func (Logger) ContextLogger added in v0.6.0

func (c Logger) ContextLogger(next http.Handler) http.Handler

Jump to

Keyboard shortcuts

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