{"id":51181,"library":"cockroachdb-tokenbucket","title":"Token Bucket","description":"Package tokenbucket implements a token bucket rate limiter.","status":"active","version":"0.0.0-20230807174530-cc333fc44b06","language":"go","source_language":null,"source_url":"https://github.com/cockroachdb/tokenbucket","tags":["rate-limiting","token-bucket","concurrency"],"install":[{"cmd":"go get github.com/cockroachdb/tokenbucket","lang":"bash","label":"Install github.com/cockroachdb/tokenbucket"}],"dependencies":[],"imports":[{"symbol":"tokenbucket","correct":"github.com/cockroachdb/tokenbucket"}],"quickstart":{"code":"package main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\t\"github.com/cockroachdb/tokenbucket\"\n)\n\nfunc main() {\n\ttb := tokenbucket.New(10, time.Second)\n\tfmt.Println(tb.TryConsume(1))\n}","lang":"go","description":"Creates a token bucket with capacity 10 and refill rate 1 per second, then tries to consume one token."},"warnings":[],"env_vars":null,"search_vec":"'bucket':2,8,16 'concurr':17 'implement':5 'limit':10,13 'packag':3 'rate':9,12 'rate-limit':11 'token':1,7,15 'token-bucket':14 'tokenbucket':4","created_at":"2026-06-15T06:03:27.140950+00:00","updated_at":"2026-06-15T06:03:27.140950+00:00","problems":[],"ecosystem":"go","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/cockroachdb/tokenbucket","github":"https://github.com/cockroachdb/tokenbucket","docs":"https://pkg.go.dev/github.com/cockroachdb/tokenbucket#section-documentation","changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-15","next_check":"2026-12-12","install_tag":null}}