Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PrivateIPAddressRegex = regexp.MustCompile(`(10(?:\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$)|(192\\.168(?:\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2}$)|(172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2}$)`)
PrivateIPAddressRegex for detects a valid IP address
Functions ¶
Types ¶
type RedisIPRateLimiter ¶
type RedisIPRateLimiter struct {
// contains filtered or unexported fields
}
RedisIPRateLimiter is the redis store that implements IP Based rate limiter
func NewRedisIPRateLimiter ¶
func NewRedisIPRateLimiter(redisClient *redis.Client, rate limiter.Rate, excludedIPs []string, excludedUserAgents []string) (redisLimiter RedisIPRateLimiter, err error)
NewRedisIPRateLimiter initializes RedisIPRateLimiter
func (RedisIPRateLimiter) Limit ¶
func (r RedisIPRateLimiter) Limit() echo.MiddlewareFunc
Limit limit request by IP
Click to show internal directories.
Click to hide internal directories.