Restful weather API based on virtual crossing service. This project adds cache layer to the based API.
Additionally, there is also performance testing with k6 (see load_test.js and smoke_test.js).
For rate limiting, it uses token bucket from golang.org/x/time/rate (see middlewares.go)
Live demo : https://go-weather.fly.biz.id/docs
- clone this repo
- spin up redis instance
make docker-run - create .env file (see
env-sample) - run the API
make run
Run build make command with tests
make allBuild the application
make buildRun the application
make runCreate DB container
make docker-runShutdown DB Container
make docker-downLive reload the application:
make watchRun the smoke test:
make smoke_testRun the load test:
make load_testClean up binary from the last build:
make clean