Documentation
¶
Overview ¶
Package limiter implements a simple blocking rate limiter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimiter ¶
type RateLimiter interface {
// Wait will block until the next request can be made.
Wait()
}
Rate limiter is a blocking rate limiter.
func NewRateLimiter ¶
func NewRateLimiter(timeBetweenRequests time.Duration) RateLimiter
NewRateLimiter creates a new rate limiter that limits to 1 query per the given duration. It will panic if duration <= 0
