{"id":22741819,"url":"https://github.com/t2bot/go-leaky-bucket","last_synced_at":"2025-09-10T18:47:20.977Z","repository":{"id":227766245,"uuid":"772294077","full_name":"t2bot/go-leaky-bucket","owner":"t2bot","description":"Leaky bucket meter implementation in Go","archived":false,"fork":false,"pushed_at":"2024-04-01T19:44:42.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T06:33:57.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t2bot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-14T22:56:09.000Z","updated_at":"2024-03-15T02:51:58.000Z","dependencies_parsed_at":"2024-04-01T20:50:22.576Z","dependency_job_id":null,"html_url":"https://github.com/t2bot/go-leaky-bucket","commit_stats":null,"previous_names":["t2bot/go-leaky-bucket"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2bot%2Fgo-leaky-bucket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2bot%2Fgo-leaky-bucket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2bot%2Fgo-leaky-bucket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2bot%2Fgo-leaky-bucket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t2bot","download_url":"https://codeload.github.com/t2bot/go-leaky-bucket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246273552,"owners_count":20750906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T00:18:03.645Z","updated_at":"2025-03-30T04:14:19.869Z","avatar_url":"https://github.com/t2bot.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-leaky-bucket\n[![GoDoc](https://pkg.go.dev/badge/github.com/t2bot/go-leaky-bucket)](https://pkg.go.dev/github.com/t2bot/go-leaky-bucket)\n\n[Leaky bucket meter](https://en.wikipedia.org/wiki/Leaky_bucket#As_a_meter) implementation in Go.\n\nThis implementation atomically drains when its value is being mutated rather than using a timer or continual\ndrain. Before mutation, the bucket will drain the supplied number of units as many times as necessary to match\nthe precision of the supplied interval.\n\nFor example, if a bucket is created which drains 5 units every 2 minutes, then after 2.5 minutes only 5 units will\nbe drained. However, the 30 seconds of \"unused\" drain time will be accounted for to ensure future drains are kept\naccurate. If another 1.5 minutes were to pass, the bucket will drain by another 5 units because the unused time\nwas recorded.\n\nAs a bonus, this implementation supports encoding and decoding the bucket in binary, allowing it to be persisted\nacross application restarts or shared among processes as needed. Synchronization logic is left as an exercise for\nthe consumer.\n\nSee [`./examples`](./examples) for usage and inspiration.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft2bot%2Fgo-leaky-bucket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft2bot%2Fgo-leaky-bucket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft2bot%2Fgo-leaky-bucket/lists"}