timewindow

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSlideTimeWindowLimiter

func NewSlideTimeWindowLimiter(throughput int, duration time.Duration, windowBuckets int) (ratelimit.Limiter, error)

Types

type SlideTimeWindowLimiter

type SlideTimeWindowLimiter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

nolint: govet

func (*SlideTimeWindowLimiter) Count

func (s *SlideTimeWindowLimiter) Count() int

func (*SlideTimeWindowLimiter) Take

func (*SlideTimeWindowLimiter) Wait

func (r *SlideTimeWindowLimiter) Wait(ctx context.Context) (err error)

wait until take a token or timeout

Jump to

Keyboard shortcuts

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