Limiter
goralim
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Limiter
-
Goralim – A rate limiting package for Go to handle distributed workloads
Fun weekend project but definitely not production-ready (no tests, no error handling, etc.). If readers are looking for something production-ready to use, consider https://github.com/go-redis/redis_rate (which implements GCRA/leaky bucket), or https://github.com/ulule/limiter (which uses a much simpler algorithm, but has good middleware).
goralim
-
my first 100 stars on the GitHub repo
If you're someone who loves to contribute to open-source projects, you're more than welcome to contribute to my project goralim. If this story of mine gave you a little bit of motivation to work on that stupid idea you've had, go work on it. Build it for yourself. And I would appreciate some stars too on my project.
-
Goralim – A rate limiting package for Go to handle distributed workloads
Nice project, but for other readers, please don't use this in production. There is almost no error handling whatsoever going on: for example, see https://github.com/0verread/goralim/blob/main/goralim.go#L36. What happens if the redis calls in this function fail? If the Get here https://github.com/0verread/goralim/blob/main/goralim.go#L58 fails, for example if your redis connection dies, the code will always return false.
The code in the README will also result in a panic if the connection to the redis client fails.
Consider using https://github.com/go-redis/redis_rate (which implements leaky bucket/GCRA) or https://github.com/ulule/limiter (which implements a much more basic rate limiting algorithm, but has good middleware support) instead.
What are some alternatives?
Tollbooth - Simple middleware to rate-limit HTTP requests.
Beego - beego is an open-source, high-performance web framework for the Go programming language.
easy-middleware - easy-middleware is a lightweight json middleware stack for Go >= 1.7.
Iris - The fastest HTTP/2 Go Web Framework. New, modern and easy to learn. Fast development with Code you control. Unbeatable cost-performance ratio :rocket:
Echo - High performance, minimalist Go web framework
GoSwagger - Swagger 2.0 implementation for go
XFF - A Golang Middleware to handle X-Forwarded-For Header
samb - Go HTTP route management, with a structured API.
formjson - Go net/http handler to transparently manage posted JSON
Gin - Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
CORS - Go net/http configurable handler to handle CORS requests
go-json-rest - A quick and easy way to setup a RESTful JSON API