Documentation ¶
Overview ¶
Package ratelimit implements distributed rate limiting using redis function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Error = errors.New("ratelimit")
Functions ¶
This section is empty.
Types ¶
type FixedWindow ¶
FixedWindow implements the Fixed Window algorithm.
func NewFixedWindow ¶
func NewFixedWindow(client *redis.Client, opt *FixedWindowOption) *FixedWindow
type FixedWindowOption ¶
func (*FixedWindowOption) Valid ¶
func (opt *FixedWindowOption) Valid() error
type TokenBucket ¶
func NewTokenBucket ¶
func NewTokenBucket(client *redis.Client, opt *TokenBucketOption) *TokenBucket
Click to show internal directories.
Click to hide internal directories.