The service used to count number of requests, every minute.
- Go - ^1.23.2
- Docker - ^27.2.0
- Docker Compose - ^2.29.2
- Make
If not using docker
- Redis-cli
- kafka
git clone git@github.com:littlestar642/counter-service.git
cd counter-service
Docker
make docker-build
Local
mkdir build
go build -o build/counter-service cmd/counter.go
Docker
make compose-run
Local
- might need to udpate kafka and redis address
./build/counter-service
GET - Accept request id (and optionally endpoint) to increment count
curl http://localhost:8080/api/verve/accept?id=0
curl http://localhost:8080/api/verve/accept?id=43&endpoint=http%3A%2F%2Flocalhost%3A8080%2Fapi%2Fverve%2Faccept
Response
- "ok" - denotes success
- "failed" - denotes failure
For testing purpose:
POST - Accept request count
curl -X POST http://localhost:8080/api/verve/accept?count=0