- Install Go version 1.19
- Install Mockery version v2.13 or later
- Use GoLand (recommended)
- Download dependencies with command
go mod download
- Create
.env
file based on.env.example
Use this command to run API app from root directory:
go run app/api/api.go
Use this command to run consumer app from root directory:
go run app/consumer/consumer.go
Use this command to run scheduler app from root directory:
go run app/scheduler/scheduler.go
To generate mock, run:
mockery --all --keeptree --case underscore --with-expecter
To run unit tests:
go test ./...
This README would normally document whatever steps are necessary to get your application up and running.
- Quick summary
- Version
- Learn Markdown
- Summary of set up
- Configuration
- Dependencies
- Database configuration
- How to run tests
- Deployment instructions
- Writing tests
- Code review
- Other guidelines
- Repo owner or admin
- Other community or team contact
An example repo for auto generating RESTful API doc using https://github.com/swaggo/swag
- Copy
.env.example
to.env
in the same directory - Update environment variables with credentials for mysql
go run main.go
Run the app, and browse to http://localhost:[SERVER_PORT]/swagger/index.html. Find the Swagger 2.0 Api documents