rateLimiter

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 5 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
	ResetTime       time.Time
	Mutex           sync.RWMutex
}

func (*IndiscriminateRateLimiter) Limit added in v0.6.0

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

type IndiscriminateThrottler added in v0.5.0

type IndiscriminateThrottler struct {
	Attempts        int
	AttemptsAllowed int
	Seconds         int
	ResetTime       time.Time
	Mutex           sync.RWMutex
}

func (*IndiscriminateThrottler) Limit added in v0.6.0

func (self *IndiscriminateThrottler) Limit(req *http.Request) bool

type IpRateLimiter

type IpRateLimiter struct {
	Data            map[string]*RateLimitData
	Seconds         int
	AttemptsAllowed int
	Mutex           sync.RWMutex
}

func (*IpRateLimiter) Limit added in v0.6.0

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

type IpThrottler added in v0.6.0

type IpThrottler struct {
	Data            map[string]*RateLimitData
	Seconds         int
	AttemptsAllowed int
	Mutex           sync.RWMutex
}

func (*IpThrottler) Limit added in v0.6.0

func (self *IpThrottler) Limit(req *http.Request) bool

type RateLimitData

type RateLimitData struct {
	Attempts  int
	ResetTime time.Time
}

type RateLimiter added in v0.6.0

type RateLimiter interface {
	Limit(req *http.Request) bool
}

Jump to

Keyboard shortcuts

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