limiter

package
v0.0.0-...-9dac649 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPRateLimiter

type IPRateLimiter struct {
	Visitors map[string]*Visitor
	Mu       *sync.RWMutex
	Configs  configs.RateLimiter
}

func (*IPRateLimiter) Init

func (rl *IPRateLimiter) Init()

func (*IPRateLimiter) Limit

func (rl *IPRateLimiter) Limit() gin.HandlerFunc

type Visitor

type Visitor struct {
	Limiter  *rate.Limiter
	LastSeen time.Time
}

Jump to

Keyboard shortcuts

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