https://github.com/felipeaz/go-rate-limiter
Rate Limiter is used in situations where it's required to limit the number of requests our service is receiving
https://github.com/felipeaz/go-rate-limiter
golang rate-limit resilience
Last synced: 3 months ago
JSON representation
Rate Limiter is used in situations where it's required to limit the number of requests our service is receiving
- Host: GitHub
- URL: https://github.com/felipeaz/go-rate-limiter
- Owner: felipeaz
- Created: 2023-01-21T11:49:45.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-01-23T22:15:23.000Z (over 2 years ago)
- Last Synced: 2025-01-07T05:21:51.039Z (4 months ago)
- Topics: golang, rate-limit, resilience
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-rate-limiter
Rate Limiter is used in situations where it's required to limit the number of requests a service is receiving.In this example, I created a simple endpoint that handles a request for 10 seconds, let's say that our service takes that
amount of time to process a single request. Each request will have an ID defined on the requestID middleware, that ID
will be used to identify which request got processed at the end.The rate limiter will be 3 request per second, if the 4th request is sent, it'll be denied
## Testing
Go to the project root, execute the main go file then run `make deny` to simulate few denies or `make run` for a single request