rate

package
v1.45.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Unlicense Imports: 4 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 struct {
	// contains filtered or unexported fields
}

Limiter is a set of rate limiters for specific ids.

func New

func New(params Params) *Limiter

New limiter for rate.

func (*Limiter) Get added in v1.37.0

func (u *Limiter) Get(id string) *rate.Limiter

Get a limiter that is specified for that id.

type Params added in v1.38.0

type Params struct {
	Every time.Duration
	Burst uint
	TTL   time.Duration
	Cache *ristretto.Cache
}

Params for rate.

Jump to

Keyboard shortcuts

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