middleware

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recoverer

func Recoverer(logger *log.Logger) func(http.Handler) http.Handler

Recoverer recovers from panics in downstream handlers and returns HTTP 500. If logger is nil, log.Default() is used.

func RequestLogger

func RequestLogger(logger *log.Logger) func(http.Handler) http.Handler

RequestLogger logs each incoming request and the response status. If logger is nil, log.Default() is used.

func Timeout

func Timeout(timeout time.Duration) func(http.Handler) http.Handler

Timeout wraps a handler with a request timeout. If the handler does not complete before the duration, 503 Service Unavailable is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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