-
Install go v1.20 or above to use go modules
-
Make vendored copy of depedencies
go mod vendor
-
Copy app.config.sample yml into local environment. For example:
cp app.config.sample.yml app.config.local.yml
-
Fill the yml values
-
Make sure your redis and mysql database is ready
-
Install
goose
for db migrations :go get -u github.com/pressly/goose/cmd/goose
-
Migration Up
goose -dir . postgres "host=localhost port=5432 user=root password=root dbname=automation_engine sslmode=disable" up
-
Migration Down
goose -dir . postgres "host=localhost port=5432 user=root password=root dbname=automation_engine sslmode=disable" down
-
Manual run
go run main.go
-
[v] Initiate project
-
Initiate postgresSQL as data store
-
Unit test and integration test
.
|-- main execution file
|-- domain contains modular code based per domain/ feature
| |-- domain-name is domain or feature name
| | |-- delivery is folder consist of delivery process of the domain
| | | |-- http represent that domain feature will deliver with http endpoint
| | |-- repository is a domain's repository acting to store the data
| | | |-- repository.go represent that domain feature using postgres depedencies as data store
| | `-- usecase is a domain's usecase acting for logical process of the feature
| | `-- usecase.go is a file for usecase interface implementation
| `--`-- domain-name.go is main file of domain feature represent of interface implementation from usecase and repository
|-- models is a directory consist of struct models used in codebase
|-- shared is a directory consist of shared package for the codebase
|-- app.config.yml is a file containing the env value for the codebase
`-- README.md is a codebase documentation
- Goose: https://github.com/pressly/goose
- MockGen <go.uber.org/mock/gomock>