middleware

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCORSMiddleware

func ApplyCORSMiddleware(handler http.Handler) http.Handler

CORSMiddleware is a middleware function that adds CORS headers to HTTP responses.

func AuthMiddleware

func AuthMiddleware(next http.Handler) http.Handler

AuthMiddleware validates JWT tokens and protects routes

func GetClaimsFromContext

func GetClaimsFromContext(ctx context.Context) (jwt.MapClaims, bool)

GetClaimsFromContext retrieves claims from request context

func LimiterMiddleware

func LimiterMiddleware(next http.Handler) http.Handler

func LoggingMiddleware

func LoggingMiddleware(next http.Handler) http.Handler

func PrometheusMiddleware

func PrometheusMiddleware(next http.Handler, requestsTotal *prometheus.CounterVec, requestDuration *prometheus.HistogramVec) http.Handler

PrometheusMiddleware is a middleware for recording Prometheus metrics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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