Skip to content

matthiassommer/golang-microservice-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang microservice template

Exemplary microservice implementation in Golang. Uses a controller/repository pattern to handle typical CRUD actions. Exposes the controller methods via HTTP endpoints.

Go Report Card

Dependencies

go mod download

Mocks

Mocks are generated with (Mockery)[https://github.com/vektra/mockery]. Put the executable under $GOPATH/bin/mockery and create mocks for interfaces with

%GOPATH%/bin/mockery -all -case=underscore -inpkg

Lint

  1. Get golangci-lint from Github.
  2. Follow the steps under Editor Integration.
  3. Execute with
golangci-lint run

Running the service

To run the service, follow these steps:

go run main.go

To run the service in a docker container

docker build -t pizza-service .

Once image is built use

docker run --rm -it pizza-service

About

Golang microservice template.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published