{"id":19956317,"url":"https://github.com/althk/ratelimiter","last_synced_at":"2025-08-31T14:08:59.352Z","repository":{"id":201063958,"uuid":"706874959","full_name":"althk/ratelimiter","owner":"althk","description":"An easy to use ratelimiter in golang","archived":false,"fork":false,"pushed_at":"2023-10-19T18:42:24.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T15:44:04.368Z","etag":null,"topics":["golang","ratelimiter","sliding-window-algorithm","token-bucket-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/althk.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":"2023-10-18T19:35:47.000Z","updated_at":"2023-10-18T19:41:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"8acf498c-514d-4e98-81b8-623a1e62dd00","html_url":"https://github.com/althk/ratelimiter","commit_stats":null,"previous_names":["althk/ratelimiter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/althk/ratelimiter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/althk%2Fratelimiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/althk%2Fratelimiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/althk%2Fratelimiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/althk%2Fratelimiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/althk","download_url":"https://codeload.github.com/althk/ratelimiter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/althk%2Fratelimiter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272988919,"owners_count":25026961,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["golang","ratelimiter","sliding-window-algorithm","token-bucket-algorithm"],"created_at":"2024-11-13T01:33:03.390Z","updated_at":"2025-08-31T14:08:59.328Z","avatar_url":"https://github.com/althk.png","language":"Go","readme":"## Rate Limiter\n\n![Rate Limiter](https://github.com/althk/ratelimiter/actions/workflows/ci-main.yml/badge.svg)\n\nProvides the following rate limiters:\n\n- [Token Bucket](https://en.wikipedia.org/wiki/Token_bucket)\n- [Sliding Window Counter](https://blog.cloudflare.com/counting-things-a-lot-of-different-things/)\n\nThe package also provides the following:\n\n### storage drivers\n\n- Local (in-memory)\n  - A rate limiter configured with this store simply stores all data locally in memory.\n    It evicts all keys that have not been touched in the last minute.\n- Redis backed\n  - This provides a more reliable storage for the rate limiter.\n  - Every key has a TTL of one minute.\n  - Currently does not have TLS support.\n\n### middleware\n\n- http\n  - a pluggable http middleware to make it easy for using the rate limiters.\n  - see [example/](example) directory for usage.\n\n### configuration\n\nThe rate limiters can be configured via the `LimiterOptions` type.\nSee [example/main.go](example/main.go) for hints.\n\n\n### TODOs\n\n- add TLS support for Redis store\n- make the error message configurable (currently it returns a 429 status code with \"Quota Exceeded\" as the message)\n- add GRPC middleware\n- allow fetching limits per IP from a config source and use custom limits per client,\n  and fall back to the global default limit if a client does not have a custom rate limit\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falthk%2Fratelimiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falthk%2Fratelimiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falthk%2Fratelimiter/lists"}