Versions in this module Expand all Collapse all v0 v0.55.2 Apr 12, 2025 v0.55.1 Apr 12, 2025 Changes in this version + type Limiter struct + func NewLimiter[T comparable](tokensPerSecond, burstSize float64) *Limiter[T] + func (l *Limiter[T]) TokenMap() map[T]float64 + func (l *Limiter[T]) TokenMapAt(at time.Time) map[T]float64 + func (l *Limiter[T]) Tokens(id T) float64 + func (l *Limiter[T]) TokensAt(id T, at time.Time) float64 + func (l *Limiter[T]) Use(id T, n float64) bool + func (l *Limiter[T]) UseAt(id T, n float64, at time.Time) bool + type LimiterSingle struct + func NewLimiterSingle(tokensPerSecond, burstSize float64) *LimiterSingle + func (l *LimiterSingle) Tokens() float64 + func (l *LimiterSingle) TokensAt(at time.Time) float64 + func (l *LimiterSingle) Use(n float64) bool + func (l *LimiterSingle) UseAt(n float64, at time.Time) bool