Versions in this module Expand all Collapse all v1 v1.3.0 Dec 17, 2025 Changes in this version + var RoleLimits = map[string]struct{ ... } + func GetLimitForRole(role string) (int, time.Duration) + type Config struct + Enabled bool + RequestsPerTimeFrame int + TimeFrame time.Duration + type FixedWindowRateLimiter struct + func NewFixedWindowLimiter(limit int, window time.Duration) *FixedWindowRateLimiter + func (rl *FixedWindowRateLimiter) Allow(ip string) (bool, time.Duration) + type Limiter interface + Allow func(ip string) (bool, time.Duration) + type RedisSlidingLimiter struct + Client *redis.Client + func NewRedisSlidingLimiter(client *redis.Client) *RedisSlidingLimiter + func (r *RedisSlidingLimiter) Allow(ctx context.Context, key string, limit int, window time.Duration) (bool, time.Duration, error)