Registry / utility / kevinms-leakybucket-go

kevinms-leakybucket-go

JSON →
library0.0.0-20200115003610-082473db97cagogounverified

Package leakybucket implements a scalable leaky bucket algorithm as a meter for rate limiting.

go get github.com/kevinms/leakybucket-go
INSTALL
IMPORT
SIG · KEVINMS-LEAKYBUCKE
K
kevinms-leakybucket-go
utilitygov0.0.0-20200115003610-082473db97ca
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

leakybucket
github.com/kevinms/leakybucket-go

Creates a leaky bucket with capacity 10 and rate 1 per second, then adds a drop.

package main import ( "fmt" "time" "github.com/kevinms/leakybucket-go" ) func main() { bucket := leakybucket.New(10, time.Second) fmt.Println(bucket.Add(1)) // true if within capacity }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.0.0-20200115003610-082473db97calatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
kevinms-leakybucket-go — go get kevinms-leakybucket-go · libregistry