Skip to content

A high-performance API rate limiter written in Go with support for both fixed and sliding window algorithms.

License

Notifications You must be signed in to change notification settings

amish-go/LimiterX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LimiterX

Go Version License Performance

A high-performance API rate limiter with fixed and sliding window algorithms.


Features

  • Fixed Window & Sliding Window algorithms
  • Per-IP rate limiting
  • In-memory cache with automatic cleanup
  • Metrics and health check endpoints
  • Configurable via environment variables

Installation

git clone <repository-url>
cd limiterx
go mod init limiterx
go mod tidy
go run main.go

Configuration

  • PORT - Server port (default: 8080)
  • ALGORITHM - fixed or sliding (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.go

API Endpoints

GET /api/resource - Protected resource with rate limiting

GET /metrics - Rate limiter statistics

GET /health - Health check

License

MIT License

Contact

Email: contact.amish@yahoo.com

About

A high-performance API rate limiter written in Go with support for both fixed and sliding window algorithms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages