Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CompoundRule ¶ added in v1.33.0
type CompoundRule struct{}
type IpRateLimiter ¶ added in v1.29.0
type IpRateLimiter struct {
// contains filtered or unexported fields
}
func NewIpRateLimiter ¶ added in v1.29.0
func NewIpRateLimiter(r rate.Limit, b int) *IpRateLimiter
NewIpRateLimiter .
func (*IpRateLimiter) AddIP ¶ added in v1.29.0
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 ¶ added in v1.29.0
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 ¶ added in v1.29.0
type IpRateRule struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.