Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompoundRule ¶
type CompoundRule struct{}
type IpRateLimiter ¶
type IpRateLimiter struct {
// contains filtered or unexported fields
}
func NewIpRateLimiter ¶
func NewIpRateLimiter(r rate.Limit, b int) *IpRateLimiter
NewIpRateLimiter .
func (*IpRateLimiter) AddIP ¶
func (i *IpRateLimiter) AddIP(ip string) *rate.Limiter
AddIP creates a new rate limiter and adds it to the ips map, using the IP address as the key
func (*IpRateLimiter) GetLimiter ¶
func (i *IpRateLimiter) GetLimiter(ip string) *rate.Limiter
GetLimiter returns the rate limiter for the provided IP address if it exists. Otherwise, calls AddIP to add IP address to the map
type IpRateRule ¶
type IpRateRule struct {
// contains filtered or unexported fields
}
type RuleResult ¶
func CheckRules ¶
func CheckRules(ruleIds []string, r *http.Request) (*RuleResult, error)
Click to show internal directories.
Click to hide internal directories.