limiter

package
v0.0.0-...-278ce41 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 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(ctx context.Context) error
	Limit() rate.Limit
}

Jump to

Keyboard shortcuts

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