ratelimit

package
v0.2.25 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

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

func NewBucket

func NewBucket(interval time.Duration, cap int64) *Bucket

func (*Bucket) TakeAvailable

func (b *Bucket) TakeAvailable(count int64) int64

type Clock

type Clock interface {
	Now() time.Time
	Sleep(d time.Duration)
}

Jump to

Keyboard shortcuts

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