Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimiter ¶
RateLimiter is an interface use to apply rate limiting
func NewRateLimiter ¶
func NewRateLimiter(conf RateLimitingConfig) (RateLimiter, error)
NewRateLimiter create new rate limiter
type RateLimitingConfig ¶
type RateLimitingConfig struct {
// Provider of the rate limiting store
Provider string `toml:"provider"`
// Tokens allowed per interval
Tokens int `toml:"tokens"`
// Interval until tokens reset
Interval string `toml:"interval"`
}
RateLimiterConfig for rate-limiter configuration section
Click to show internal directories.
Click to hide internal directories.