Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListPermutations ¶
Types ¶
type LeakyBucket ¶
func NewLeakyBucket ¶
func NewLeakyBucket(RequestCount int, TimeIntervalMs int64) *LeakyBucket
func (*LeakyBucket) Cleanup ¶
func (l *LeakyBucket) Cleanup(olderThanTs int64)
type TokenBucket ¶
type TokenBucket struct { RefillIntervalSec int // 10 / sec RefillCount int MaxCount int LastUpdatedTs int CurrentCount int sync.RWMutex }
func NewTokenBucket ¶
func NewTokenBucket(RefillInterval int, RefillCount int) *TokenBucket
func (*TokenBucket) IsRateLimited ¶
func (t *TokenBucket) IsRateLimited(timestamp int) bool
Click to show internal directories.
Click to hide internal directories.