Awesome
ThrottleX: Scalable Rate Limiting for Go APIs
Welcome to ThrottleX, a powerful and flexible rate-limiting library for Go! 🚀 ThrottleX is designed to provide multiple rate limiting algorithms, easy integration, and scalable storage backends for your APIs.
For complete documentation, examples, and detailed setup instructions, please visit the ThrottleX Wiki.
Features
-
Multiple Algorithms:
- Fixed Window
- Sliding Window
- Token Bucket
-
Pluggable Storage Backends:
- In-Memory Store
- Redis Store
-
Thread-Safe and Efficient:
- Designed for high concurrency and low latency.
- Includes mutex cleanup to prevent memory leaks.
-
Highly Configurable:
- Customize limits, window sizes, and keys.
- Support for dynamic configurations.
-
Future Expansion:
- Upcoming support for additional rate limiting policies like Leaky Bucket, Concurrency Limit, and more.
Installation
To install Throttlex, use go get
:
go get -u github.com/neelp03/throttlex
For detailed setup instructions, refer to the Installation and Setup Wiki Page.
Usage
Import the package into your Go project:
import (
"github.com/neelp03/throttlex/ratelimiter"
"github.com/neelp03/throttlex/store"
)
For full examples of integrating ThrottleX with REST, gRPC, and GraphQL APIs, please refer to the Examples Wiki Page.
Rate Limiting Algorithms
ThrottleX currently supports the following rate limiting algorithms:
- Fixed Window Limiter
- Sliding Window Limiter
- Token Bucket Limiter
To learn more about these algorithms and how they work, visit the Rate Limiting Algorithms Wiki Page.
Contributing
Contributions are welcome! Please follow these steps:
-
Fork the Repository: Click on the "Fork" button at the top.
-
Clone Your Fork:
git clone https://github.com/neelp03/throttlex.git cd throttlex
-
Create a Branch:
git checkout -b feature/your-feature-name
-
Make Changes: Implement your feature or fix.
-
Run Tests:
go test -race -v ./...
-
Commit and Push:
git add . git commit -m "Add your feature" git push origin feature/your-feature-name
-
Create a Pull Request: Open a pull request against the
main
branch.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Inspired by the need for flexible and efficient rate limiting in Go applications.
- Thanks to the Go community for their invaluable contributions.
Contact
For questions or support, please open an issue on the GitHub repository.