limiter

package
v0.0.0-...-caa0154 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Per

func Per(eventCount int, duration time.Duration) rate.Limit

Types

type MultiLimiter

type MultiLimiter struct {
	// contains filtered or unexported fields
}

func Multi

func Multi(limiters ...RateLimiter) *MultiLimiter

func (*MultiLimiter) Limit

func (l *MultiLimiter) Limit() rate.Limit

func (*MultiLimiter) Wait

func (l *MultiLimiter) Wait(ctx context.Context) error

type RateLimiter

type RateLimiter interface {
	Wait(context.Context) error
	Limit() rate.Limit
}

Jump to

Keyboard shortcuts

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