Versions in this module Expand all Collapse all v8 v8.0.1 Jan 2, 2025 v8.0.0 Nov 4, 2024 Changes in this version + const Inf + const InfDuration + type Limit float64 + func Every(interval time.Duration) Limit + type Limiter struct + func NewLimiter(r Limit, b int) *Limiter + func (lim *Limiter) Allow() bool + func (lim *Limiter) AllowN(now time.Time, n int) bool + func (lim *Limiter) Burst() int + func (lim *Limiter) Limit() Limit + func (lim *Limiter) Reserve() *Reservation + func (lim *Limiter) ReserveN(now time.Time, n int) *Reservation + func (lim *Limiter) SetBurst(newBurst int) + func (lim *Limiter) SetBurstAt(now time.Time, newBurst int) + func (lim *Limiter) SetLimit(newLimit Limit) + func (lim *Limiter) SetLimitAt(now time.Time, newLimit Limit) + func (lim *Limiter) TokensAt(t time.Time) float64 + func (lim *Limiter) Wait(ctx context.Context) (err error) + func (lim *Limiter) WaitN(ctx context.Context, n int) (err error) + type Reservation struct + func (r *Reservation) Cancel() + func (r *Reservation) CancelAt(now time.Time) + func (r *Reservation) Delay() time.Duration + func (r *Reservation) DelayFrom(now time.Time) time.Duration + func (r *Reservation) OK() bool Other modules containing this package github.com/didip/tollbooth/v7