Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

go-masonry/tutorial

Repository files navigation

Tutorial

NOTE This tutorial is outdated, instead read here: https://go-masonry.github.io and use this template

This tutorial will explain how to build a gRPC web service using go-masonry/mortar step by step.

Prerequisites

How to read this tutorial

There are 7 parts in this tutorial, each part adds on top of previous one

  1. Tutorial service API
  2. Project structure and business logic
  3. Dependency Injection and Mortar
  4. Wiring/Instrumentation of everything together
  5. Mortar Middleware (Tracing, Monitoring, etc)
  6. Tests example
  7. Makefile

You can create a local git repository and copy 01-api to it. Once you seen/understand the code, commit. Then copy 02-api contents to your directory. This will overwrite some code.

Repeat for each subsequent part. This way you will have git to show you what actually changed.

*** Make sure to adjust imports accordingly.

Alternate way to pass through tutorial

Read the docs of all 7 parts described above and clone the alternate-example. You'll find there almost the same code organized in a different way: there are 2 independent microservices and common module.