rate

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

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

func NewLimiter

func NewLimiter(resetAfter time.Duration, limit int) *Limiter

func NewLimiterInit

func NewLimiterInit(resetAfter time.Duration, limit int, init int) *Limiter

func (*Limiter) Update

func (v *Limiter) Update(resetAfter time.Duration, limit int)

func (*Limiter) Wait

func (v *Limiter) Wait(ctx context.Context) error

Jump to

Keyboard shortcuts

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