This project is a rate limiter implemented in Go.
This assumes you have Go 1.21 or higher as thats what I used while developing this rate limiter.
It also assumes some basic docker / redis / Go knowledge.
- Clone the repository:
git clone https://github.com/yourusername/go-rate-limiter.git
cd go-rate-limiter
- Build the Docker image:
make docker-build
- Create and start a redis container from redis image
docker pull redis
make start-redis-local
When running dev/prod environments, make sure to have the right configuration files.
You can run the project locally or in a development environment.
Start a local Redis server:
make start-redis-local
- Run the application:
make run-local
To stop the local Redis server, use make stop-redis-local.
To debug the Redis server, use make debug-redis.
You can send a GET request to the "/" route of your application using curl. To send the request 10 times, use
make test-curl COUNT=10.
You can replace 10 with the number of requests you want to send. To change the configuration of the rate limiter, you can use the config files // TODO, not yet implemented