This a simple project illustrates how gPRC works with Go with server and client implementations.
root
| - greet/
| -- greet_client
| -- greet_server
| -- greetpb
| - calculator/
| -- calculator_client
| -- calculator_server
| -- calculatorpb
client folder contains code that a server sends requests from. server folder contains code that a server sends responds to requests.
There are few things you'll need to setup to get going:
Install Golang from offical doc
- Install VSCode
- Install VSCode Extensions:
vscode-proto3
andClang-Format
On MacOSX, open a command line and type brew install protobuf
go get -u google.golang.org/grpc
The script below automatically generates go proto file based on messages definitions.
run generate.sh
file
e.g.
go run greet/greet_server/server.go
e.g.
go run greet/greet_client/client.go