rateLimiter

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 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 IndiscriminateRateLimiter

type IndiscriminateRateLimiter struct {
	Attempts        int
	AttemptsAllowed int
	Seconds         int
	LastAccess      time.Time
}

func (*IndiscriminateRateLimiter) RateLimit

func (self *IndiscriminateRateLimiter) RateLimit(req *http.Request) bool

type IpRateLimiter

type IpRateLimiter struct {
	Data            map[string]*RateLimitData
	Seconds         int
	AttemptsAllowed int
}

func (*IpRateLimiter) RateLimit

func (self *IpRateLimiter) RateLimit(req *http.Request) bool

type RateLimitData

type RateLimitData struct {
	Attempts   int
	LastAccess time.Time
}

Jump to

Keyboard shortcuts

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