Versions in this module Expand all Collapse all v1 v1.0.0 Mar 4, 2026 Changes in this version + type BackoffOptions struct + ServerDelay time.Duration + type ConcurrentRateLimiter struct + func NewConcurrentRateLimiter(opts ...RateLimiterOption) *ConcurrentRateLimiter + func (r *ConcurrentRateLimiter) Backoff(ctx context.Context, resource string, opts ...BackoffOptions) + func (r *ConcurrentRateLimiter) BaseDelay() time.Duration + func (r *ConcurrentRateLimiter) Jitter() time.Duration + func (r *ConcurrentRateLimiter) ResetBackoff(host string) + func (r *ConcurrentRateLimiter) ResolveDelay(ctx context.Context, host string) time.Duration + func (r *ConcurrentRateLimiter) ResourceTimings() map[string]resourceTiming + func (r *ConcurrentRateLimiter) SetBaseDelay(baseDelay time.Duration) + func (r *ConcurrentRateLimiter) SetDebugLogger(logger DebugLogger) + func (r *ConcurrentRateLimiter) SetJitter(jitter time.Duration) + func (r *ConcurrentRateLimiter) SetResourceDelay(resource string, delay time.Duration) + func (r *ConcurrentRateLimiter) Wait(ctx context.Context, resource string) error + type DebugLogger interface + Enabled func() bool + LogBackoff func(ctx context.Context, resource string, count int, delay time.Duration, ...) + LogRateLimit func(ctx context.Context, resource string, delay time.Duration, ...) + type NoOpLogger struct + func NewNoOpLogger() *NoOpLogger + func (n *NoOpLogger) Enabled() bool + func (n *NoOpLogger) LogBackoff(_ context.Context, _ string, _ int, _ time.Duration, _ ...any) + func (n *NoOpLogger) LogRateLimit(_ context.Context, _ string, _ time.Duration, _ RateLimitReason, _ ...any) + type RateLimitReason string + const RateLimitReasonBackoff + const RateLimitReasonBaseDelay + const RateLimitReasonConsumeDelay + type RateLimiter interface + Backoff func(ctx context.Context, resource string, opts ...BackoffOptions) + ResetBackoff func(resource string) + ResolveDelay func(ctx context.Context, resource string) time.Duration + SetBaseDelay func(baseDelay time.Duration) + SetDebugLogger func(logger DebugLogger) + SetJitter func(jitter time.Duration) + SetResourceDelay func(resource string, delay time.Duration) + Wait func(ctx context.Context, resource string) error + type RateLimiterOption func(*rateLimiterConfig) + func WithDebugLogger(debugLogger DebugLogger, attrs ...any) RateLimiterOption + func WithInitialDuration(d time.Duration) RateLimiterOption + func WithJitter(d time.Duration) RateLimiterOption + func WithLogAttrs(attrs ...any) RateLimiterOption + func WithMaxDuration(d time.Duration) RateLimiterOption + func WithMultiplier(m float64) RateLimiterOption