Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
Bucket represents single token bucket
func New ¶
New is constructor for creating single token bucket with specific capacity (token count) and rate (tokens/second) at which buckets gain free space
type Buckets ¶
type Buckets struct {
// contains filtered or unexported fields
}
Buckets is structure for handling multiple token buckets with same rate and initial capacity
func NewBuckets ¶
NewBuckets is constructor for buckets handler, with initial bucket capacity and rate (tokens/second) at which buckets gain free space
func (*Buckets) Add ¶
Add adds token in bucket with specified name and returns free space left in bucket and ok if token was added
Click to show internal directories.
Click to hide internal directories.