leakybucket

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	ID string
	// contains filtered or unexported fields
}

Bucket struct

func NewBucket

func NewBucket(id string, rateLimit uint64, duration time.Duration, inactiveCycles uint64) *Bucket

NewBucket Bucket constructor

func (*Bucket) CheckLimit

func (b *Bucket) CheckLimit(ctx context.Context) bool

CheckLimit Method to check bucket limit

func (*Bucket) Inactive

func (b *Bucket) Inactive(ctx context.Context) <-chan struct{}

Inactive Method to get "done" channel

func (*Bucket) ResetLimit

func (b *Bucket) ResetLimit(ctx context.Context)

ResetLimit Method to reset bucket limit

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL