Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter(rate int, interval time.Duration) *RateLimiter
func (*RateLimiter) Allow ¶
func (rl *RateLimiter) Allow() bool
func (*RateLimiter) AllowN ¶
func (rl *RateLimiter) AllowN(n int) bool
func (*RateLimiter) Interval ¶
func (rl *RateLimiter) Interval() time.Duration
func (*RateLimiter) Rate ¶
func (rl *RateLimiter) Rate() int
func (*RateLimiter) Wait ¶
func (rl *RateLimiter) Wait()
func (*RateLimiter) WaitN ¶
func (rl *RateLimiter) WaitN(n int)
Click to show internal directories.
Click to hide internal directories.