limiter

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 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