This repository explain implementation of Go for building multiple microservices using a single codebase. Using Standard Golang Project Layout and Clean Architecture
Please install latest candi CLI first, and then:
$ candi -init
If include GRPC handler, run this command (must install protoc
compiler min version libprotoc 3.14.0
):
$ make proto service={{service_name}}
If using SQL database, run this command for migration:
$ make migration service={{service_name}} dbconn="{{YOUR DATABASE URL CONNECTION}}"
$ candi -run
$ candi -run -service {{service_a}},{{service_b}}
$ candi -add-module -service {{service_name}}
- Generate mocks first (using mockery):
$ make mocks service={{service_name}}
- Run test:
$ make test service={{service_name}}
$ make sonar level={{level}} service={{service_name}}
{{level}}
is service environment, example: dev
, staging
, or prod
$ make docker service={{service_name}}