ratelimiter

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2023 License: MIT Imports: 1 Imported by: 2

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

type DoneFunc func(DoneInfo)

DoneFunc is done function.

type DoneInfo

type DoneInfo struct {
	Err error
}

DoneInfo is done info.

type RateLimiter

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

RateLimiter 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