Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRemoteIP ¶
GetRemoteIP returns the ip of requester Don't care if the ip is real or not
Types ¶
type CaddyLimiter ¶
type CaddyLimiter struct {
Keys map[string]*rate.Limiter
// contains filtered or unexported fields
}
func NewCaddyLimiter ¶
func NewCaddyLimiter() *CaddyLimiter
func (*CaddyLimiter) RetryAfter ¶
func (cl *CaddyLimiter) RetryAfter(keys []string) time.Duration
type RateLimit ¶
type RateLimit struct {
Next httpserver.Handler
Rules []Rule
}
RateLimit is an http.Handler that can limit request rate to specific paths or files
Click to show internal directories.
Click to hide internal directories.