View on GitHub
Overview
A thread-safe rate limiting middleware built in pure Go that restricts API requests per client using the fixed-window algorithm. Implements proper concurrency patterns with sync.Mutex, automatic memory cleanup, and works as plug-and-play middleware for any HTTP handler—all without external dependencies.
Key Features
| Feature | Description |
|---|---|
| Thread-Safe Concurrency | Uses sync.Mutex for safe concurrent request handling |
| Fixed-Window Algorithm | 5 requests per minute default limit |
| Automatic Memory Cleanup | Background goroutines prevent memory leaks |
| Zero Dependencies | Built entirely with Go standard library |
| Plug-and-Play Middleware | Works with any http.Handler |
| IP-Based Tracking | Identifies and tracks clients by IP address |