Documentation
¶
Overview ¶
Package middleware provides HTTP middleware components for the backend server. It includes middleware for authentication, CORS, request logging, request ID tracking, and panic recovery to ensure robust and secure API operation.
Index ¶
- Constants
- func Auth(config AuthConfig) func(http.Handler) http.Handler
- func CORS(config CORSConfig) func(http.Handler) http.Handler
- func GetRequestID(ctx context.Context) string
- func Logging(next http.Handler) http.Handler
- func Recovery(next http.Handler) http.Handler
- func RequestID(next http.Handler) http.Handler
- type AuthConfig
- type CORSConfig
Constants ¶
View Source
const RequestIDKey contextKey = "request_id"
Variables ¶
This section is empty.
Functions ¶
func GetRequestID ¶
Types ¶
type AuthConfig ¶
Click to show internal directories.
Click to hide internal directories.