{"id":26154392,"url":"https://github.com/rcdmk/go-ratelimiter","last_synced_at":"2026-04-24T14:04:53.194Z","repository":{"id":241410753,"uuid":"804710707","full_name":"rcdmk/go-ratelimiter","owner":"rcdmk","description":"Go Rate Limiter is a Go package that provides rate limiting functionality with middleware implementations for standard lib and common frameworks.","archived":false,"fork":false,"pushed_at":"2025-01-03T00:30:50.000Z","size":34,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T08:36:02.818Z","etag":null,"topics":["go-lib","go-stdlib","http-middleware","rate-limit"],"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/rcdmk.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-05-23T05:50:08.000Z","updated_at":"2025-01-03T00:30:53.000Z","dependencies_parsed_at":"2024-05-28T07:43:35.747Z","dependency_job_id":"f49200fc-3cfd-45c3-b505-18cfe70bfdf2","html_url":"https://github.com/rcdmk/go-ratelimiter","commit_stats":null,"previous_names":["rcdmk/go-ratelimiter"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/rcdmk/go-ratelimiter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fgo-ratelimiter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fgo-ratelimiter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fgo-ratelimiter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fgo-ratelimiter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rcdmk","download_url":"https://codeload.github.com/rcdmk/go-ratelimiter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rcdmk%2Fgo-ratelimiter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32226415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go-lib","go-stdlib","http-middleware","rate-limit"],"created_at":"2025-03-11T08:29:27.750Z","updated_at":"2026-04-24T14:04:53.176Z","avatar_url":"https://github.com/rcdmk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Rate Limiter\n\nGo Rate Limiter is a Go package that provides rate limiting functionality with middleware implementations for standard lib and common frameworks.\n\n## Features\n\n- Simple and easy-to-use rate limiter for Go applications.\n- Middleware implementations for standard lib and popular frameworks.\n- Configurable rate limiting options.\n- In-memory caching for rate-limiter can be replaced by your own implementation.\n\n## Installation\n\nUse `go get` to install the package:\n\n```sh\ngo get github.com/rcdmk/go-ratelimiter\n```\n\n## Usage\n\nImport the package and use the `New` method to create a new rate limiter instance for use:\n\n```go\nimport (\n    // ...\n    \"github.com/rcdmk/go-ratelimiter\"\n    // ...\n)\n\n// ...\n    rateLimiter := ratelimiter.New(ratelimiter.Options{\n        MaxRatePerSecond: 15,\n        MaxBurst: 15,\n    })\n\n    if !rateLimiter.Allow(\"my-operation-name\") {\n        // over rate limit, deny action and stop execution\n        return\n    }\n\n    // proceed normaly\n// ...\n```\n\n### Middleware\n\n**`StdLib`** is a standard lib compatible middleware implementation for limitting requests served through an HTTP server.\n\nIt is also compatible with all frameworks that can use standard lib middleware (eg. [chi](https://github.com/go-chi/chi), [Gorilla](https://github.com/gorilla/mux), etc.).\n\n```go\nimport (\n    // ...\n    \"github.com/rcdmk/go-ratelimiter/ratelimitermiddleware\"\n    // ...\n)\n\n// ...\n\noptions := ratelimitermiddleware.Options{\n    MaxRatePerSecond: 15,\n    MaxBurst:         10,\n    SourceHeaderKey:  \"Authorization\",\n}\n\n// wrap your handler with the middleware\nrateLimitedHandler := ratelimitermiddleware.StdLib(handler, options)\n\nhttp.Handle(\"/my-resource\", rateLimitedHandler)\n\n// ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcdmk%2Fgo-ratelimiter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frcdmk%2Fgo-ratelimiter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frcdmk%2Fgo-ratelimiter/lists"}