Versions in this module Expand all Collapse all v1 v1.0.0 Dec 14, 2025 Changes in this version + type Decision struct + Allowed bool + Burst float64 + LimitRPS float64 + Remaining float64 + RetryAfterSeconds int + type Limiter interface + Allow func(ctx context.Context, key string, rps float64, burst float64, cost float64) (Decision, error) + Close func() error + type MemoryLimiter struct + func NewMemoryLimiter(ttl time.Duration, cleanupEvery time.Duration) *MemoryLimiter + func (m *MemoryLimiter) Allow(ctx context.Context, key string, rps float64, burst float64, cost float64) (Decision, error) + func (m *MemoryLimiter) Close() error + type RedisLimiter struct + func NewRedisLimiter(rdb *redis.Client) *RedisLimiter + func (r *RedisLimiter) Allow(ctx context.Context, key string, rps float64, burst float64, cost float64) (Decision, error) + func (r *RedisLimiter) Close() error