Skip to content

Latest commit

 

History

History
34 lines (31 loc) · 868 Bytes

readme.md

File metadata and controls

34 lines (31 loc) · 868 Bytes

gRPC example in Go

installation

install protocol buffers: https://github.com/protocolbuffers/protobuf#protocol-compiler-installation

$ brew install protobuf

This will install all main languages support, except Go, so follow these instructions for Go support https://github.com/golang/protobuf#installation

go get -u github.com/golang/protobuf/protoc-gen-go
go get -u -v github.com/golang/protobuf/proto

Then make sure your $GOBIN is in your path:

export GOPATH="$HOME/go"
export GOBIN="$GOPATH/bin"

export PATH="$GOBIN:$PATH"

generate the protocol buffer code

(this step is optional since the generated code is shipped along in ths repository)

$ go run calculator_client/client.go

running the gRPC Server

Server

$ go run calculator_server/server.go

Client

$ go run calculator_client/client.go