Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPBasedRateLimiter ¶
type IPBasedRateLimiter struct {
// contains filtered or unexported fields
}
func NewIPBasedRateLimiter ¶
func NewIPBasedRateLimiter(limit int, window time.Duration, window2 string) *IPBasedRateLimiter
type IPBasedRateLimiters ¶
type IPBasedRateLimiters []*IPBasedRateLimiter
var (
Limits IPBasedRateLimiters
)
func (IPBasedRateLimiters) AllowPassCheck ¶
func (iprls IPBasedRateLimiters) AllowPassCheck(ip string)
func (IPBasedRateLimiters) LoadFromCache ¶
func (iprls IPBasedRateLimiters) LoadFromCache() error
func (IPBasedRateLimiters) Prune ¶
func (iprls IPBasedRateLimiters) Prune(ip string)
func (IPBasedRateLimiters) SaveCache ¶
func (iprls IPBasedRateLimiters) SaveCache() error
type SlidingWindowRateLimiter ¶
type SlidingWindowRateLimiter struct {
// contains filtered or unexported fields
}
func NewSlidingWindowRateLimiter ¶
func NewSlidingWindowRateLimiter(limit int, window time.Duration, window2 string) *SlidingWindowRateLimiter
Click to show internal directories.
Click to hide internal directories.