Documentation
¶
Overview ¶
Package redislimiter is the Redis-backed sliding-window rate limiter over ratelimit.Limit buckets, shared by every replica. While Redis fails it limits in process instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter struct {
// contains filtered or unexported fields
}
Limiter is a Redis sliding-window limiter using ZSETs, with an in-process fallback holding the same limits.
func New ¶
func New(rdb redis.UniversalClient, limits map[string]ratelimit.Limit, prefix string) (*Limiter, error)
New builds a Redis sliding-window limiter whose keys live under prefix (the deployment namespace, #307): <prefix><key>:<bucket>.
Click to show internal directories.
Click to hide internal directories.