Versions in this module Expand all Collapse all v0 v0.0.7 Aug 18, 2026 Changes in this version + var ErrInvalidAuthHeader = errors.New("el header Authorization debe tener el formato 'Bearer <token>'") + var ErrMissingAuthHeader = errors.New("falta el header Authorization") + func Chain(h http.Handler, mws ...Middleware) http.Handler + func ClaimsFromContext(ctx context.Context) (*token.Claims, bool) + func FiberAuth() fiber.Handler + func FiberLogger() fiber.Handler + func FiberRecovery() fiber.Handler + func GinAuth() gin.HandlerFunc + func GinLogger() gin.HandlerFunc + func GinRecovery() gin.HandlerFunc + func RegisterFiberRoutes(group fiber.Router, routes []Route[fiber.Handler], opts ...RegisterOption) + func RegisterGinRoutes(group *gin.RouterGroup, routes []Route[gin.HandlerFunc], ...) + func RemoteIPKeyFunc(r *http.Request) string + type CORSConfig struct + AllowCredentials bool + AllowedHeaders []string + AllowedMethods []string + AllowedOrigins []string + MaxAge int + type KeyFunc func(r *http.Request) string + type Logger interface + Info func(message string) + type MemoryRateLimiter struct + func NewMemoryRateLimiter(limit int, window time.Duration) *MemoryRateLimiter + func (l *MemoryRateLimiter) Allow(key string) bool + func (l *MemoryRateLimiter) Cleanup() + type Middleware func(http.Handler) http.Handler + func CORS(cfg CORSConfig) Middleware + func RateLimit(limiter RateLimiter, keyFunc KeyFunc) Middleware + func RequestLogger(log Logger) Middleware + func RequireActiveSession(sessions *token.SessionManager) Middleware + func RequireAuth(manager *token.JWTManager) Middleware + func RequireRole(roles ...string) Middleware + type RateLimiter interface + Allow func(key string) bool + type RegisterOption func(*RegisterOptions) + func WithAuthManager(manager *token.JWTManager) RegisterOption + func WithGroupName(name string) RegisterOption + type RegisterOptions struct + AuthManager *token.JWTManager + GroupName string + type Route struct + Handler H + Method string + Path string + Protected bool