middleware

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APIKey

func APIKey(next http.Handler, key string) http.Handler

APIKey validates X-Api-Key header only. Query param removed for security.

func CORS

func CORS(next http.Handler) http.Handler

CORS adds permissive CORS headers.

func Logger

func Logger(next http.Handler) http.Handler

Logger logs request method, path, duration, and request ID.

func RateLimit

func RateLimit(next http.Handler, maxReqs int, windowMs int) http.Handler

RateLimit per-IP using token bucket.

func RequestID

func RequestID(next http.Handler) http.Handler

RequestID generates unique ID per request for tracing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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