Code Monkey home page Code Monkey logo

go-microservice-template's Introduction

Go Microservice Template

This is the code repository for Go Microservice Template, published by InfraNyx.

Build, test, and deploy robust golang microservices

About the project

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.

Status

The template project is in alpha status.

Reference

Getting started

Prerequisites

Setup

  1. 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
  1. Install the dependencies:
make dep
  1. Run the development server:
make run_dev

This 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.

Testing

To run the tests, use the following command:

make test

To generate a test coverage report, use the following command:

make test_coverage

Linting

To lint the code, use the following command:

make lint

This will run all available linters, including Go lint, Dockerfile lint, and YAML lint.

Building

To build the binary, use the following command:

make build

This will create a binary in the out/bin directory. You can run the binary with the following command:

make run

Cleaning

To clean the build artifacts and generated files, use the following command:

make clean

This will remove the bin and out directories, as well as any build-related files.

Continuous Integration

To run the continuous integration tasks, use the following command:

make ci

This will run the tests, linting, and code coverage tasks, and generate the corresponding reports. The reports will be saved to the out directory.

Notes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.