Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLimitExceed = errors.New("rate limit exceeded")
ErrLimitExceed is returned when the rate limiter rejects a request.
Functions ¶
This section is empty.
Types ¶
type BBR ¶
type BBR struct {
// contains filtered or unexported fields
}
BBR implements a BBR-like adaptive limiter.
type Option ¶
type Option func(*options)
Option configures a BBR limiter.
func WithCPUQuota ¶
WithCPUQuota sets the real CPU quota if it differs from GOMAXPROCS.
func WithCPUThreshold ¶
WithCPUThreshold sets the CPU threshold, scaled from 0 to 1000.
func WithWindow ¶
WithWindow sets the rolling window duration.
Click to show internal directories.
Click to hide internal directories.