ratelimit

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: MIT Imports: 1 Imported by: 46

README

Ratelimit

Algorithms

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrLimitExceed is returned when the rate limiter is
	// triggered and the request is rejected due to limit exceeded.
	ErrLimitExceed = errors.New("rate limit exceeded")
)

Functions

This section is empty.

Types

type DoneFunc added in v0.1.1

type DoneFunc func(DoneInfo)

DoneFunc is done function.

type DoneInfo

type DoneInfo struct {
	Err error
}

DoneInfo is done info.

type Limiter

type Limiter interface {
	Allow() (DoneFunc, error)
}

Limiter is a rate limiter.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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