ratelimit

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDelayingLimiter

func NewDelayingLimiter(limit Waiting) endpoint.Middleware

func NewErrorLimiter

func NewErrorLimiter(limit Allowing) endpoint.Middleware

Types

type Allowing

type Allowing interface {
	Allow() bool
}

type AllowingFunc

type AllowingFunc func() bool

func (AllowingFunc) Allow

func (f AllowingFunc) Allow() bool

type Waiting

type Waiting interface {
	Wait(ctx context.Context) error
}

type WaitingFunc

type WaitingFunc func(ctx context.Context) error

func (WaitingFunc) Wait

func (f WaitingFunc) Wait(ctx context.Context) error

Jump to

Keyboard shortcuts

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