Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Global struct { Enabled bool Rate float64 Burst int } PerIP struct { Enabled bool Rate float64 Burst int } Redis *redis.Client // Optional: only required for prefork mode UseRedis bool // Whether to use Redis (true if prefork is enabled) }
Config holds configuration for rate limiting
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter manages both global and per-IP rate limiting
func (*RateLimiter) Check ¶
func (r *RateLimiter) Check(ip string) error
Check checks both global and IP-based rate limits
Click to show internal directories.
Click to hide internal directories.