Documentation
¶
Overview ¶
Package ratelimit defines common rate limiting logic and config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// Common configuration
Type Type `env:"RATE_LIMIT_TYPE, default=NOOP"`
Tokens uint64 `env:"RATE_LIMIT_TOKENS, default=120"`
Interval time.Duration `env:"RATE_LIMIT_INTERVAL, default=1m"`
// HMACKey is the key to use when calculating the HMAC of keys before saving
// them in the rate limiter.
HMACKey envconfig.Base64Bytes `env:"RATE_LIMIT_HMAC_KEY, required"`
// Redis configuration
Redis redis.Config `env:",prefix=RATE_LIMIT_"`
}
Config represents rate limiting configuration
Click to show internal directories.
Click to hide internal directories.