limiters

package
v0.0.0-...-eb3ab3a Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter interface {
	Wait(ctx context.Context) error
	WaitN(ctx context.Context, n int) error
	Shutdown()
	Reset()
}

func NewSlidingWindowLimiter

func NewSlidingWindowLimiter(
	windowSize, slideInterval time.Duration,
	capacity int,
) (Limiter, error)

func NewTokenBucketLimiter

func NewTokenBucketLimiter(r int, burst int) Limiter

Jump to

Keyboard shortcuts

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