middleware

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxRequestBodySize

func MaxRequestBodySize(maxBytes int64) func(http.Handler) http.Handler

MaxRequestBodySize limits the size of the request body.

func Recovery

func Recovery(logger *slog.Logger) func(http.Handler) http.Handler

Recovery catches panics and returns a 500 instead of crashing.

func RequestLogger

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

RequestLogger logs each HTTP request with method, path, status, and duration.

func SecurityHeaders

func SecurityHeaders(next http.Handler) http.Handler

SecurityHeaders adds security headers to every response.

Types

This section is empty.

Jump to

Keyboard shortcuts

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