Documentation
¶
Overview ¶
Package middleware provides reusable HTTP middleware.
Index ¶
- func Recovery(log *logger.Logger) func(http.Handler) http.Handler
- func RequestID() func(http.Handler) http.Handler
- func Stats(name string, s *statter.Statter) func(http.Handler) http.Handler
- func Tracing(op string, opts ...otelhttp.Option) func(http.Handler) http.Handler
- func WithRecovery(h http.Handler, log *logger.Logger) http.Handler
- func WithRequestID(h http.Handler) http.Handler
- func WithStats(name string, s *statter.Statter, h http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithRecovery ¶
WithRecovery recovers from panics and log the error.
func WithRequestID ¶ added in v2.7.0
WithRequestID sets the request id on request context and in the response.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.