This is the code repository for Go Microservice Template, published by InfraNyx.
Build, test, and deploy robust golang microservices
The template is used to create golang project. All golang projects must follow the conventions in the template. Calling for exceptions must be brought up in the engineering team.
The template project is in alpha status.
- Database Schema and Migrations
- Deployment Instructions
- Design Decisions and Technical Considerations
- Development and Operations Processes
- Environment Variables
- Clone the repository and navigate to the root directory of the project:
git clone https://github.com/infranyx/go-microservice-template.git
cd go-microservice-template- Install the dependencies:
make dep- Run the development server:
make run_devThis will start the http server on port 4000 and grpc server on port 3000. You can customize the ports by setting the HTTP_PORT and GRPC_PORT environment variable.
To run the tests, use the following command:
make testTo generate a test coverage report, use the following command:
make test_coverageTo lint the code, use the following command:
make lintThis will run all available linters, including Go lint, Dockerfile lint, and YAML lint.
To build the binary, use the following command:
make buildThis will create a binary in the out/bin directory. You can run the binary with the following command:
make runTo clean the build artifacts and generated files, use the following command:
make cleanThis will remove the bin and out directories, as well as any build-related files.
To run the continuous integration tasks, use the following command:
make ciThis will run the tests, linting, and code coverage tasks, and generate the corresponding reports. The reports will be saved to the out directory.