Documentation ¶
Overview ¶
/Users/sookh.com/go/pkg/mod/github.com/!jubaer!hossain/rootx@v1.4.7/pkg/core/middleware/limiterMidleware.go
Index ¶
- Constants
- func AuthMiddleware(next http.Handler) http.Handler
- func CorsMiddleware(next http.Handler) http.Handler
- func GetClaimsFromContext(ctx context.Context) (jwt.MapClaims, bool)
- func LimiterMiddleware(next http.Handler) http.Handler
- func LoggingMiddleware(next http.Handler) http.Handler
- func PrometheusMiddleware(next http.Handler, requestsTotal *prometheus.CounterVec, ...) http.Handler
- func SecurityHeadersMiddleware(next http.Handler) http.Handler
- type RateLimitConfig
Constants ¶
View Source
const (
ClaimsKey key = iota
)
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
AuthMiddleware validates JWT tokens and protects routes
func CorsMiddleware ¶ added in v1.4.4
CORSMiddleware is a middleware function that adds CORS headers to HTTP responses.
func GetClaimsFromContext ¶
GetClaimsFromContext retrieves claims from request context
func LimiterMiddleware ¶
LimiterMiddleware creates a new rate limiting middleware
func PrometheusMiddleware ¶
func PrometheusMiddleware(next http.Handler, requestsTotal *prometheus.CounterVec, requestDuration *prometheus.HistogramVec) http.Handler
PrometheusMiddleware is a middleware for recording Prometheus metrics.
Types ¶
Click to show internal directories.
Click to hide internal directories.