Clock is the minimum necessary interface to instantiate a rate limiter with a clock or mock clock, compatible with clocks created using github.com/andres-erbsen/clock.
Limiter is used to rate-limit some process, possibly across goroutines. The process is expected to call Take() before every iteration, which may block to throttle the goroutine.
New returns a Limiter that will limit to the given RPS.
NewUnlimited returns a RateLimiter that is not limited.
type Option func(l *limiter)
Option configures a Limiter.
WithoutSlack is an option for ratelimit.New that initializes the limiter without any initial tolerance for bursts of traffic.
WithClock returns an option for ratelimit.New that provides an alternate Clock implementation, typically a mock Clock for testing.