Documentation
¶
Overview ¶
Package ratelimit holds the token buckets behind kit's default rate limit and plugins/ratelimit: per key, up to burst requests at once, refilled at a steady rate.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter struct {
// Now is the clock; tests replace it.
Now func() time.Time
// contains filtered or unexported fields
}
Limiter limits how often each key may act. It's safe for concurrent use.
Click to show internal directories.
Click to hide internal directories.