middleware

package
v0.0.0-...-5f7e223 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CORS

func CORS(next http.Handler) http.Handler

CORS middleware handles Cross-Origin Resource Sharing Configurable via environment variables: - CORS_ALLOWED_ORIGINS: comma-separated list of allowed origins (supports wildcards like https://*.domain.com) - CORS_ALLOWED_METHODS: comma-separated list of allowed HTTP methods - CORS_ALLOWED_HEADERS: comma-separated list of allowed headers

Wildcard Support: The middleware supports wildcard patterns in origins using asterisk (*) as a wildcard character. Examples:

Note: Wildcards are converted to regex patterns for matching. Use with caution to avoid overly permissive CORS policies.

func Logging

func Logging(next http.Handler) http.Handler

Logging middleware logs HTTP requests and responses Captures method, path, status code, duration, and size

func Recovery

func Recovery(next http.Handler) http.Handler

Recovery middleware recovers from panics and returns a 500 error Logs the panic and stack trace for debugging

Types

This section is empty.

Jump to

Keyboard shortcuts

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