crash.software
Projects
Pull Requests
Issues
Builds
gophish
Code
Files
Commits
Branches
Tags
Pull Requests
Code Comments
Code Compare
Issues
List
Boards
Milestones
Builds
Statistics
Contributions
Source Lines
Child Projects
Projects
STRLCPY
gophish
Files
🤬
Sign In
d2efb18e
ROOT
/
middleware
/
ratelimit
/
ratelimit.go
Search
History
144 lines
|
ISO-8859-1
|
3 KB
Blame
Outline
2
4
8
No wrap
Soft wrap
Outline
DefaultRequestsPerMinute
DefaultCleanupInterval
DefaultExpiry
bucket
limiter
:
*rate.Limiter
lastSeen
:
time.Time
PostLimiter
visitors
:
map[string]*bucket
requestLimit
:
int
cleanupInterval
:
time.Duration
expiry
:
time.Duration
sync.RWMutex
PostLimiterOption
WithRequestsPerMinute
(requestLimit int)
:
PostLimiterOption
WithCleanupInterval
(interval time.Duration)
:
PostLimiterOption
WithExpiry
(expiry time.Duration)
:
PostLimiterOption
NewPostLimiter
(opts ...PostLimiterOption)
:
*PostLimiter
*PostLimiter
pollCleanup
()
Cleanup
()
addBucket
(ip string)
:
*bucket
allow
(ip string)
:
bool
Limit
(next http.Handler)
:
http.HandlerFunc
All occurrences
Please wait...
Page is in error, reload to recover