Documentation ¶
Index ¶
- Constants
- func Initialize()
- type Cacher
- type RateLimit
- func (rl *RateLimit) Attempts(key string) int64
- func (rl *RateLimit) AvailableIn(key string) zone.Duration
- func (rl *RateLimit) Clear(key string)
- func (rl *RateLimit) Hit(key string, decayMinutes int) int64
- func (rl *RateLimit) ResetAttempts(key string) bool
- func (rl *RateLimit) RetriesLeft(key string, maxAttempts int64) int64
- func (rl *RateLimit) TooManyAttempts(key string, maxAttempts int64) bool
Constants ¶
View Source
const RATE_LIMITE_CACHE_KEY = "TMAIC_RATE_LIMIT_%s"
View Source
const RATE_LIMITE_TIMER_CACHE_KEY = "TMAIC_RATE_LIMIT_%s_TIMER"
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize()
Types ¶
type Cacher ¶
type Cacher interface { driver.ProtoCache driver.BasicCache }
type RateLimit ¶
type RateLimit struct {
// contains filtered or unexported fields
}
func NewRateLimit ¶
func (*RateLimit) ResetAttempts ¶
func (*RateLimit) RetriesLeft ¶
Click to show internal directories.
Click to hide internal directories.