Versions in this module Expand all Collapse all v1 v1.0.1 Feb 8, 2024 v1.0.0 Feb 8, 2024 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