Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/esnunes/ratelimit
A rate limit Go library and reverse proxy
https://github.com/esnunes/ratelimit
golang leaky-bucket proxy rate-limit
Last synced: about 2 months ago
JSON representation
A rate limit Go library and reverse proxy
- Host: GitHub
- URL: https://github.com/esnunes/ratelimit
- Owner: esnunes
- License: mit
- Created: 2018-04-09T20:19:37.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-02-03T17:53:57.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T17:47:18.507Z (7 months ago)
- Topics: golang, leaky-bucket, proxy, rate-limit
- Language: Go
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rate Limit
[![Go Report Card](https://goreportcard.com/badge/github.com/esnunes/ratelimit)](https://goreportcard.com/report/github.com/esnunes/ratelimit)
## Library
## Reverse Proxy
```bash
go get github.com/esnunes/ratelimit/cmd/rl-proxyrl-proxy -h
# Rate Limit Proxy
#
# Usage:
# rl-proxy [flags]
#
# Flags:
# -a, --addr string bind address ip:port (default ":8080")
# -b, --burst int maximum burst size of requests (default 1)
# -h, --help help for rl-proxy
# -q, --queue int maximum queued requests
# -r, --rate float requests per second (default 2)
```- Leaky Bucket algorithm;
- Rate Limit based on target endpoint (considering connection latency);
- Queue of connections when bucket limit reached;## TODO
- [ ] Store and retrieve context values using functions;
- [ ] Calculate rate limit value based on specific date (e.g. service startup time);
- [ ] Cover with tests;
- [ ] Create docs about library usage;
- [ ] Create docs about proxy usage;
- [ ] Add Prometheus metrics support;
- [ ] Number of times a response status code occurred;
- [ ] Number of no more slots error;
- [ ] Number of requests in queue;
- [ ] Number of requests running;
- [ ] Histogram of requests response time;
- [ ] General Go statistics;## License
ratelimit is licensed under the MIT license. Check the [LICENSE](LICENSE) file for details.
## Author
[Eduardo Nunes](http://nunes.io)