Example structure to start a microservices project with golang. Using a MySQL databaseSQL. Using a Hexagonal Architecture tha is a Clean Architecture.
If you would still prefer to do the installation manually, follow these steps:
Clone the repo:
git clone https://github.com/gbrayhan/microservices-go
If you need, configure the environment variables in file config.json, if you use docker-compose leave the variables set in the file config.json.example
cp config.json.example config.json
TL;DR command list
git clone https://github.com/gbrayhan/microservices-go
cd microservices-go
cp config.json.example config.json
docker-compose up --build -d
docker-compose up --build -d
swag init -g src/infrastructure/rest/routes/routes.go
To visualize the swagger documentation on local use
http://localhost:8080/v1/swagger/index.html
To see the postman collection use
https://www.postman.com/kts-mexico/workspace/boilerplategomicroservice
# run recursive test
go test ./test/unit/...
# clean go test results in cache
go clean -testcache
golangci-lint run ./...