golang-microservice-best-practices

command module
v0.0.0-...-4adf093 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 4 Imported by: 0

README

golang-microservice-best-practices

This is a simple simple REST microservice with arguably best practices and integrations for golang.

The codebase can be visualized as below:

Visualization of the codebase

Running the unit test

Execute below command from the root of this directory.

go test ./...

or

make test

Running the mutation test

Execute below command from the root of this directory.

go-mutesting --test-recursive api/...

or

make mutation-test

Start the app

Execute below command:

go run main.go

or

make start

Open the browser and make call to the url:

http://localhost:5000/greetings/greet/abhishek

You should receive a response with greeting based on the path argument passed after "/greet/" and time of the day.

Example:

Hi abhishek, Good Morning.

Running the bdd test

Make sure the app is still running, we are used godog for writing the tests.

go get github.com/cucumber/godog/cmd/godog

Execute below command from the root of this directory.

godog run

or

make bdd-test

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL