Documentation ¶
Index ¶
- Variables
- func TimeTrack(start time.Time, name string)
- type Bucket
- type RateLimiter
- func (l *RateLimiter) CleanUpFullBuckets()
- func (l *RateLimiter) GetShard(key int64) *Shard
- func (l *RateLimiter) Len() int64
- func (l *RateLimiter) Reduce(key string, maxTokens int64, refillTime int64, refillAmount int64, ...) (int64, error)
- func (l *RateLimiter) Remove(key string)
- func (l *RateLimiter) StartCleanUpFullBuckets()
- type Shard
Constants ¶
This section is empty.
Variables ¶
View Source
var SHARDS = uint64(1024)
Functions ¶
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
func NewRateLimiter ¶
func NewRateLimiter() *RateLimiter
func (*RateLimiter) CleanUpFullBuckets ¶
func (l *RateLimiter) CleanUpFullBuckets()
func (*RateLimiter) GetShard ¶
func (l *RateLimiter) GetShard(key int64) *Shard
func (*RateLimiter) Len ¶
func (l *RateLimiter) Len() int64
func (*RateLimiter) Remove ¶
func (l *RateLimiter) Remove(key string)
func (*RateLimiter) StartCleanUpFullBuckets ¶
func (l *RateLimiter) StartCleanUpFullBuckets()
Click to show internal directories.
Click to hide internal directories.