limiter

package
v0.0.0-...-3a79dc6 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

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

type RateLimiter

type RateLimiter struct {
	sync.Mutex //@TODO : RWMutex ?
	// contains filtered or unexported fields
}

func New

func New(l rate.Limit, b int) *RateLimiter

func NewUnlimited

func NewUnlimited() *RateLimiter

func (*RateLimiter) Cleanup

func (rl *RateLimiter) Cleanup(t time.Duration)

func (*RateLimiter) GetAccess

func (rl *RateLimiter) GetAccess(ip string) *rate.Limiter

Jump to

Keyboard shortcuts

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