ratelimiter
a distributed ratelimiting implemention base on redis, using token bucket algorithm
usage:
r := New(redisClient, "ratelimit:test", capacity, rate)
// try to take a token
if r.IsAllow(){
// --snip--
}
a distributed ratelimiting implemention base on redis, using token bucket algorithm
usage:
r := New(redisClient, "ratelimit:test", capacity, rate)
// try to take a token
if r.IsAllow(){
// --snip--
}