ratelimiter

package
v2.34.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: Apache-2.0 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 interface {
	Name() string
	TakeIfAvailable(ctx context.Context, label string, count float64) (ok bool, waitTime time.Duration, remaining float64, current float64)
	Take(ctx context.Context, label string, count float64) (ok bool, waitTime time.Duration, remaining float64, current float64)
	Return(ctx context.Context, label string, count float64) (remaining float64, current float64)
	SetPassThrough(passthrough bool)
	GetPassThrough() bool
	Close() error
}

RateLimiter is a generic limiter interface.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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