{"id":37114880,"url":"https://github.com/be9/speedbump","last_synced_at":"2026-01-14T13:30:07.102Z","repository":{"id":57576497,"uuid":"357760753","full_name":"be9/speedbump","owner":"be9","description":"A Redis-backed rate limiter in Go","archived":false,"fork":true,"pushed_at":"2021-04-14T04:11:33.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"v2","last_synced_at":"2024-06-21T14:42:58.220Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"etcinit/speedbump","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/be9.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}},"created_at":"2021-04-14T03:25:57.000Z","updated_at":"2021-04-14T04:10:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/be9/speedbump","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/be9/speedbump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/be9%2Fspeedbump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/be9%2Fspeedbump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/be9%2Fspeedbump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/be9%2Fspeedbump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/be9","download_url":"https://codeload.github.com/be9/speedbump/tar.gz/refs/heads/v2","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/be9%2Fspeedbump/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28421212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2026-01-14T13:30:06.300Z","updated_at":"2026-01-14T13:30:07.041Z","avatar_url":"https://github.com/be9.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [speedbump](https://github.com/etcinit/speedbump) [![GoDoc](https://godoc.org/github.com/etcinit/speedbump?status.svg)](http://godoc.org/github.com/etcinit/speedbump)\n\nA Redis-backed Rate Limiter for Go\n\n[![wercker status](https://app.wercker.com/status/9832225d9e89d9702d4ce7ca4e8e4285/m/master \"wercker status\")](https://app.wercker.com/project/bykey/9832225d9e89d9702d4ce7ca4e8e4285)\n\n## Cool stuff\n\n- Backed by Redis, so it keeps track of requests across a cluster\n- Extensible timing functions. Includes defaults for tracking requests per\nsecond, minute, and hour\n- Works with IPv4, IPv6, or any other unique identifier\n- Example middleware included for [Gin](https://github.com/gin-gonic/gin) (See: [ginbump](https://github.com/etcinit/speedbump/blob/master/ginbump)) and\n[Negroni](https://github.com/codegangsta/negroni) (See:\n[negronibump](https://github.com/etcinit/speedbump/blob/master/negronibump))\n\n## Versions\n\n|Branch|Go Get Command|Client Version|-|\n|---|---|---|---|\n|**v2**|`go get gopkg.in/etcinit/speedbump.v2`|`gopkg.in/redis.v5`|[Link](https://gopkg.in/etcinit/speedbump.v2)|\n|**v1**, **master**|`go get gopkg.in/etcinit/speedbump.v1`|`gopkg.in/redis.v3`|[Link](https://gopkg.in/etcinit/speedbump.v1)|\n|**v0**|`go get gopkg.in/etcinit/speedbump.v0`|`gopkg.in/redis.v2`|[Link](https://gopkg.in/etcinit/speedbump.v0)|\n\n## Usage\n\n- Get a working Redis server\n- Go get:\n\n```sh\n$ go get github.com/etcinit/speedbump\n```\n\n- Include it in your code\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/etcinit/speedbump\"\n\t\"gopkg.in/redis.v5\"\n)\n\nfunc main() {\n\tclient := redis.NewClient(\u0026redis.Options{\n\t\tAddr:     \"localhost:6379\",\n\t\tPassword: \"\",\n\t\tDB:       0,\n\t})\n\thasher := speedbump.PerSecondHasher{}\n\n\t// Here we create a limiter that will only allow 5 requests per second\n\tlimiter := speedbump.NewLimiter(client, hasher, 5)\n\n\tfor {\n\t\t// This example has a hardcoded IP, but you would replace it with the IP\n\t\t// of a client on a real case.\n\t\tsuccess, err := limiter.Attempt(\"127.0.0.1\")\n\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\n\t\tif success {\n\t\t\tfmt.Println(\"Successful!\")\n\t\t} else {\n\t\t\tfmt.Println(\"Limited! :(\")\n\t\t}\n\n\t\ttime.Sleep(time.Millisecond * time.Duration(100))\n\t}\n}\n```\n\n- Output:\n\n```\nSuccessful!\nSuccessful!\nSuccessful!\nSuccessful!\nSuccessful!\nSuccessful!\nLimited! :(\nLimited! :(\nLimited! :(\nLimited! :(\nLimited! :(\nSuccessful!\nSuccessful!\nSuccessful!\nSuccessful!\nSuccessful!\nSuccessful!\nLimited! :(\nLimited! :(\nLimited! :(\nLimited! :(\nSuccessful!\nSuccessful!\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbe9%2Fspeedbump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbe9%2Fspeedbump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbe9%2Fspeedbump/lists"}