limiter

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GCInterval = time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IPRateLimiter

type IPRateLimiter struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewIPRateLimiter

func NewIPRateLimiter(limit rate.Limit, burst int, logger *zap.Logger) *IPRateLimiter

NewIPRateLimiter .

func (*IPRateLimiter) CanServe

func (i *IPRateLimiter) CanServe(ip string) bool

func (*IPRateLimiter) GetOreCreateLimiter

func (i *IPRateLimiter) GetOreCreateLimiter(ip string) *rate.Limiter

Jump to

Keyboard shortcuts

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