A simple gRPC client and server written in go.
Both the client and server use the same code generated by the protobuf definition (proto3).
This project is meant to be a template to allow one to quickly bootstrap a gRPC based project.
All architectural decisions are documented as architecture design records (ADR's) in the docs/adr directory.
Note: This project is a WIP and will continue to grow as expertise in gRPC based microservice architecture develops.
- protoc compiler - pre-compiled binary for your OS
- Note: add this to your path
- protoc-gen-go - protoc plugin for go
go get github.com/golang/protobuf/protoc-gen-go
-
Generate Protobuf source files:
protoc --go_out=plugins=grpc:. ./api/protobuf-spec/hello.proto
-
Build solution:
go build -o grpc main.go
-
Run Server:
./grpc -type server
-
Run client - with message "my-message":
./grpc -type client my-message
Run server and client via docker-compose:
docker-compose up --build
Note: The client continously exits when gRPC server successfully recieves message from client
- Server implementation
- Client implementation
- Unit Tests
- Containerisation (Docker)
- Create/Use distroless based prod docker image
- Docs - Architecture Design Records
- Godoc support
- Setup Makefile
- Github actions (CICD)
go test