Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*options)
Option is IpRateLimit option.
func WithSecondLimit ¶
WithSecondLimit with Limit is represented as number of events per second.
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
RateLimiter ip rate limiter
func NewRateLimiter ¶
func NewRateLimiter(opts ...Option) *RateLimiter
func (*RateLimiter) Get ¶ added in v2.0.35
func (i *RateLimiter) Get(ip string) *rate.Limiter
Get returns the rate limiter for the provided IP address if it exists. Otherwise, calls AddIP to add IP address to the map
func (*RateLimiter) GetExcludes ¶
func (i *RateLimiter) GetExcludes() []string
Click to show internal directories.
Click to hide internal directories.