Documentation ¶ Index ¶ type Limiter func New(n int) Limiter Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Limiter ¶ type Limiter interface { Use(ctx context.Context, tokens int) error } func New ¶ func New(n int) Limiter New rate limiter with a bucket size of and refill rate of n. For example, if n is 10, you could immediately use all 10 tokens, but if you want to use 10 more tokens, you'll need to wait a second for 10 tokens to be available. Source Files ¶ View all Source files rate.go Click to show internal directories. Click to hide internal directories.