ratelimit

package
v0.0.0-...-80ab217 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(parent context.Context, limit rate.Limit) context.Context

New returns a new rate limiter that allows limit events per second.

func Wait

func Wait(ctx context.Context) (err error)

Wait blocks until the rate limit configuration permits an event to happen. It returns an error if the Context is canceled, or the expected wait time exceeds the Context's Deadline.

Types

This section is empty.

Jump to

Keyboard shortcuts

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