grate

package
v0.0.0-...-37ff87a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2024 License: MIT Imports: 2 Imported by: 0

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL