- Fixed Window & Sliding Window algorithms
- Per-IP rate limiting
- In-memory cache with automatic cleanup
- Metrics and health check endpoints
- Configurable via environment variables
git clone <repository-url>
cd limiterx
go mod init limiterx
go mod tidy
go run main.goPORT- Server port (default:8080)ALGORITHM-fixedorsliding(default:sliding)REQUESTS_LIMIT- Max requests per window (default:100)WINDOW_SECONDS- Time window in seconds (default:60)
# Example
ALGORITHM=fixed REQUESTS_LIMIT=50 WINDOW_SECONDS=30 go run main.goGET /api/resource - Protected resource with rate limiting
GET /metrics - Rate limiter statistics
GET /health - Health check
MIT License
Email: contact.amish@yahoo.com