Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RateLimitMiddleware ¶
func RateLimitMiddleware(rl *RateLimiter, authPaths ...string) gin.HandlerFunc
RateLimitMiddleware returns a Gin middleware for rate limiting This is specifically for auth endpoints (handshake, execute)
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter provides rate limiting functionality
func NewRateLimiter ¶
func NewRateLimiter(maxAttempts int, windowSize, blockDuration time.Duration) *RateLimiter
NewRateLimiter creates a new rate limiter
func (*RateLimiter) Cleanup ¶
func (rl *RateLimiter) Cleanup()
cleanup runs periodically to remove expired entries
func (*RateLimiter) GetStats ¶
func (rl *RateLimiter) GetStats() map[string]interface{}
GetStats returns rate limiting statistics
func (*RateLimiter) ResetIP ¶
func (rl *RateLimiter) ResetIP(ip string)
ResetIP resets the rate limit for a specific IP (admin use only)
Click to show internal directories.
Click to hide internal directories.