About this project
Rate is a rate limiting library written in Go, intended to help Go applications control request traffic. According to its README, it emphasizes performance and offers several selectable limiting strategies.
Key points from the documentation:
- Installation is via `go get github.com/Mahu123-Locked/rate`.
- The basic API creates a limiter with a rate and burst size, e.g. `rate.NewLimiter(1, 5)` for one request per second with a burst of five, and checks requests with `limiter.Allow()`.
- Four strategies are described: token bucket (allows bursts while maintaining an average rate), leaky bucket (smooths bursts to a constant rate), fixed window (limits requests within a fixed time window), and sliding window (counts requests across overlapping windows for finer control).
- The README includes example programs for the general limiter, token bucket (`rate.NewTokenBucket`) and leaky bucket (`rate.NewLeakyBucket`).
- The project is MIT licensed and accepts contributions through forks and pull requests.
The README does not document benchmarks, thread-safety guarantees, distributed/Redis-backed limiting, or configuration options beyond the constructor arguments shown.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.