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.
- You should be familiar with Protobuf, gRPC and REST / Swagger
- Install everything related to
gRPC
starting here
- Install everything related to
- You should understand what Dependency Injection is
- Have access to Jaeger service - Optional
- Have access to Prometheus - Optional
- Tutorial service API
- Project structure and business logic
- Dependency Injection and Mortar
- Wiring/Instrumentation of everything together
- Mortar Middleware (Tracing, Monitoring, etc)
- Tests example
- 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.
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.