Documentation
¶
Overview ¶
api/middleware/auth_middleware.go
api/middleware/error_handler.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(cfg *config.Config) gin.HandlerFunc
AuthMiddleware creates a gin middleware for checking JWT authentication. It depends on the application configuration for the JWT secret.
func CombinedAuthMiddleware ¶
func ErrorHandler ¶
func ErrorHandler() gin.HandlerFunc
ErrorHandler creates a Gin middleware for centralized error handling.
func RateLimitMiddleware ¶
func RateLimitMiddleware(rl *RateLimiter) gin.HandlerFunc
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter() *RateLimiter
func (*RateLimiter) Allow ¶
func (rl *RateLimiter) Allow(ip string) bool
Click to show internal directories.
Click to hide internal directories.