The objective of this project is to centralize information about street fairs in the city of São Paulo.
This app is written in Golang. If you don't have experience with it: https://golang.org/doc/install. It depends on a Golang version with module support (at least 1.11, latest version is recommended). Should you interoperate with Golang versions >= 1.11, don't forget to proper set your GO111MODULE environment variable (https://dev.to/maelvls/why-is-go111module-everywhere-and-everything-about-go-modules-24k)
- Install
docker
anddocker-compose
Attention: you should first set $GOBIN
environment variable, add it to the $PATH
, and then run the commands bellow:
- Install dependencies
$ make clean install
- To running local dependencies if you want to run the application using local dependencies with docker, run the command below before running the API
$ make deps/up
- To run import CSV
$ make run/import file=docs/example.csv
- To stop
$ make deps/down
- To run API
$ make run/api
- To help
$ make help
- To generate
$ make coverage
- To show in browser
$ make coverage-html
Just run:
$ make test
All logs are stored in the fair.log file.
- To show logs:
$ make show/logs
Then commit the contents of docs/swagger
dir.
When change/add any HTTP API stuff, just run:
$ make swagger/api
Then commit the contents of docs/swagger
dir.
This tasks below are used from CircleCI flow but FTW:
Generate test
image to run tests and coverage:
make docker/build
With the test
image we can run test and coverage inside CircleCI:
make docker/test
make docker/coverage
Generate final image getting binary from test
image:
make docker/image