This projects targets to provide a template for a go based microservice. Things to be adapted are marked with a
within this repository.
The following dependencies are needed to use the full capacities of the template:
Building the main service library can be done with a simple
make. For verbose builds run
make VERBOSE=1. The main
command line client can be build with
go build main.go within the root directory of the repository.
Common make targets
Make targets used for development are:
make: Builds the statically linked microservice into
make doc: Run source and package documentation server and open it in the browser
make utest: Run the unit tests
make mtest: Run the module tests
make itest: Run the integration tests
make bench: Run the benchmarks
make docker: Build a local docker image as tarball in
make dockerload: Load the local docker image into the local running docker server
make rk: Build a local rkt image as aci in
make clean: Cleans the whole working directory
All binaries can be easily installed with:
make install, which should install the library and the executable
$GOBIN directory. The
service executable is the main interface of the service. For more information simply
service -h or
go run main.go -h.
The unit tests within this template should be fully mocked. If you want to run the integration tests the following dependencies needs to be fulfilled.