Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Limiter ¶
type Limiter struct {
RedisClient RedisClient
Decay time.Duration
Limit int
}
Limiter helper for making sure we don't call something too much
type RedisClient ¶
type RedisClient interface {
ZAdd(key string, members ...redis.Z) (int64, error)
ZRemRangeByScore(key, min, max string) (int64, error)
Expire(key string, expiration time.Duration) (bool, error)
ZCard(key string) (int64, error)
}
RedisClient interface need to satisfy for Limiter to work
Click to show internal directories.
Click to hide internal directories.