Documentation
¶
Overview ¶
Package ratelimit provides a distributed token bucket rate limiter backed by Redis Lua scripts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// MaxTokens is the bucket capacity (burst size).
MaxTokens int
// RefillRate is the number of tokens added per second.
RefillRate float64
}
Config configures a rate limit for a specific tier/queue.
Click to show internal directories.
Click to hide internal directories.