Versions in this module Expand all Collapse all v0 v0.0.2 Sep 9, 2024 Changes in this version + func Int64Max(a, b int64) int64 + func Int64Min(a, b int64) int64 + func IntMax(a, b int) int + type Backoff struct + Clock clock.Clock + func NewBackOff(initial, max time.Duration) *Backoff + func NewFakeBackOff(initial, max time.Duration, tc *clock.FakeClock) *Backoff + func (p *Backoff) DeleteEntry(id string) + func (p *Backoff) GC() + func (p *Backoff) Get(id string) time.Duration + func (p *Backoff) IsInBackOffSince(id string, eventTime time.Time) bool + func (p *Backoff) IsInBackOffSinceUpdate(id string, eventTime time.Time) bool + func (p *Backoff) Next(id string, eventTime time.Time) + func (p *Backoff) Reset(id string) + type Clock interface + Now func() time.Time + Sleep func(time.Duration) + type RateLimiter interface + Accept func() + QPS func() float32 + Stop func() + TryAccept func() bool + func NewFakeAlwaysRateLimiter() RateLimiter + func NewFakeNeverRateLimiter() RateLimiter + func NewTokenBucketRateLimiter(qps float32, burst int) RateLimiter + func NewTokenBucketRateLimiterWithClock(qps float32, burst int, c Clock) RateLimiter