Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BucketRateLimiter ¶
type BucketRateLimiter struct {
// contains filtered or unexported fields
}
BucketRateLimiter implements the RateLimiter interface using standard rate.Limiter.
func NewBucketRateLimiter ¶
func NewBucketRateLimiter(r rate.Limit, burst int) *BucketRateLimiter
NewBucketRateLimiter creates a new BucketRateLimiter instance.
func (*BucketRateLimiter) Allow ¶
func (l *BucketRateLimiter) Allow(item interface{}) bool
Allow returns if drops the given item.
type RateLimiter ¶
type RateLimiter interface {
Allow(item interface{}) bool
}
Click to show internal directories.
Click to hide internal directories.