Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateLimiter ¶
type RateLimiter interface {
// TryAccept returns true if a token is taken immediately. Otherwise,
// it returns false.
TryAccept() bool
// Accept will wait and not return unless a token becomes available.
Accept()
// QPS returns QPS of this rate limiter
QPS() int64
// Burst returns the burst of this rate limiter
Burst() int64
}
func NewMockRateLimiter ¶
func NewMockRateLimiter() RateLimiter
func NewRateLimiter ¶
func NewRateLimiter(qps, burst int64) RateLimiter
Click to show internal directories.
Click to hide internal directories.