middleware

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Metrics

func Metrics(pathFromRequest PathFromRequest) func(http.Handler) http.Handler

Metrics returns middleware that records request count and duration. pathFromRequest can be nil.

Types

type PathFromRequest

type PathFromRequest func(*http.Request) string

PathFromRequest returns the route pattern for the request (e.g. from chi.RouteContext). If nil, path will be "/unknown" unless status is 404 then "/not-found".

Jump to

Keyboard shortcuts

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