Documentation ¶
Overview ¶
Package ratelimit provides a mechanism to rate limit requests based on a string key, refill rate and burst amount. Under the hood, it's a token bucket of size burst amount, that refills at the refill rate.
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
}
func (*Limiter) Allow ¶
Allow checks if the limiter that belongs to 'key' has not exceeded the limit.
Click to show internal directories.
Click to hide internal directories.