Versions in this module Expand all Collapse all v1 v1.5.5 Oct 25, 2023 Changes in this version + var ErrLimitExceed = errors.New("rate limit exceeded") + type BBR struct + func NewLimiter(opts ...Option) *BBR + func (l *BBR) Allow() (DoneFunc, error) + func (l *BBR) Stat() Stat + type DoneFunc func(DoneInfo) + type DoneInfo struct + Err error + type Limiter interface + Allow func() (DoneFunc, error) + type Option func(*options) + func WithBucket(b int) Option + func WithCPUQuota(quota float64) Option + func WithCPUThreshold(threshold int64) Option + func WithWindow(d time.Duration) Option + type Stat struct + CPU int64 + InFlight int64 + MaxInFlight int64 + MaxPass int64 + MinRt int64