Hello nice reviewer(s) 👋
- Docker
Create a .env
file at the root of the repo with
GOOGLE_API_KEY=mygreatsecret
echo "GOOGLE_API_KEY=replaceme" > .env
run ./start.sh
to run the docker-compose file to start a PostgreSQL
instance and a Go HTTP API.
API is available at http://localhost:8080
To run the tests clone the repo and do go test ./...
You can see the coverage on codecov
- For the distance I assumed we're using cars
- For the listing I ordered by ID
I tried to keep them minimal:
gorilla/mux
for HTTP routingGomega/Ginkgo
for testinggorm
as an ORM- Go Client for Google Maps Services
The API controllers/handler could probably be refactored to have a bit less code duplication
There's also no authentication
Coverage is only at 80%~~ because I didn't had time to do the setup to have a DB for testing, else I would have unit tested all the database related functions.
I also included my postman collection I used when developing this. You guys must have yours but just in case 😄
Thanks and have a good day 🌻 !