Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
A collector can keep track of multiple leaky buckets
func NewCollector ¶
Creates a new collector and check for empty buckets
type LeakyBucket ¶
type LeakyBucket struct {
// contains filtered or unexported fields
}
func NewLeakyBucket ¶
func NewLeakyBucket(rate float64, capacity int64) *LeakyBucket
NewLeakyBucket creates a new LeakyBucket with the give rate and capacity.
func (*LeakyBucket) Add ¶
func (b *LeakyBucket) Add(amount int64) int64
Click to show internal directories.
Click to hide internal directories.