Exemplary microservice implementation in Golang. Uses a controller/repository pattern to handle typical CRUD actions. Exposes the controller methods via HTTP endpoints.
go mod download
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
- Get golangci-lint from Github.
- Follow the steps under Editor Integration.
- Execute with
golangci-lint run
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