Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenRateConfigForLimiter ¶
func ListenRateConfigForLimiter(channel string, pool *resourcepool.ResourcePool, limiter *RedisRollingRateLimiter) error
ListenRateConfigForLimiter subscribes on a channel, and configure limiter on RateConfig message
Types ¶
type RateConfig ¶
type RedisRollingRateLimiter ¶
type RedisRollingRateLimiter struct {
// contains filtered or unexported fields
}
RedisRollingRateLimiter
func NewRedisRollingRateLimiter ¶
func NewRedisRollingRateLimiter(prefix string, redisPool *resourcepool.ResourcePool, interval, rate int) *RedisRollingRateLimiter
func (RedisRollingRateLimiter) Check ¶
func (l RedisRollingRateLimiter) Check(key string) bool
func (RedisRollingRateLimiter) Reset ¶
func (l RedisRollingRateLimiter) Reset(key string)
type RollingRateLimiter ¶
RollingRateLimiter interface makes it easier to do unit testing.
Click to show internal directories.
Click to hide internal directories.