Documentation ¶
Index ¶
Constants ¶
View Source
const ( // NOTE: Empty RateLimiter is unlimited one UNLIMITED = 0 DISABLED = -1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimiter ¶
type RateLimiter struct {
// contains filtered or unexported fields
}
NOTE: GCRA Rate Limiter https://en.wikipedia.org/wiki/Generic_cell_rate_algorithm
func Disabled ¶
func Disabled() RateLimiter
func New ¶
func New(rl RateLimit) RateLimiter
func Unlimited ¶
func Unlimited() RateLimiter
func (*RateLimiter) Acquire ¶
func (rl *RateLimiter) Acquire() (bool, int64)
Click to show internal directories.
Click to hide internal directories.