// NewRedisRateLimitingPlugin creates a new RateLimitingPlugin
NewRedisRateLimitingPlugin creates a new RateLimitingPlugin
// NewRedisRateLimitingPlugin creates a new RateLimitingPlugin
func NewRedisRateLimitingPlugin(addrs []string, rate int, burst int, period time.Duration) *RedisRateLimitingPlugin {
	limit := redis_rate.Limit{
		Rate:   rate,
		Burst:  burst,
		Period: period,
	}
	rdb := redis.NewClusterClient(&redis.ClusterOptions{
		Addrs: addrs,
	})
	limiter := redis_rate.NewLimiter(rdb)
	return &RedisRateLimitingPlugin{
		addrs:   addrs,
		limiter: *limiter,
		limit:   limit,
	}
}
func NewRedisRateLimitingPlugin ( addrs [ ] string , rate int , burst int , period time . Duration ) * RedisRateLimitingPlugin { limit := redis_rate . Limit { Rate : rate , Burst : burst , Period : period , } rdb := redis . NewClusterClient ( & redis . ClusterOptions { Addrs : addrs , } ) limiter := redis_rate . NewLimiter ( rdb ) return & RedisRateLimitingPlugin { addrs : addrs , limiter : * limiter , limit : limit , } }
NewRedisRateLimitingPlugin creates a new RateLimitingPlugin
NewRedisRateLimitingPlugin creates a new RateLimitingPlugin