Skip to content
A little grpc demo in go
Go Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd
pkg/grpc-hello
vendor
.gitignore
Gopkg.lock
Gopkg.toml
README.md
gobuild.sh
intro to grpc and pitfalls.pdf

README.md

A little gRPC demo in Go

Running the Servers

LISTEN=:8091 go run cmd/hello-server1/main.go

and

LISTEN=:8092 go run cmd/hello-server2/main.go

Running the Clients

SERVER=:8091 go run cmd/hello-client1/main.go

and

SERVER=:8092 go run cmd/hello-client2/main.go

and

SERVERS=:8091,:8092 go run cmd/hello-client-lb/main.go

How to compile proto files

The compiled go files are checked in, but if you need to recompile them.

You need to have the proto compiler (protoc) installed with the go plugins

Then, from the pkg directory:

protoc --go_out=plugins=grpc,paths=source_relative:. grpc-hello/v1/grpc-hello.proto

and for the v2

protoc --go_out=plugins=grpc,paths=source_relative:. grpc-hello/v2/grpc-hello.proto

Other Links

You can’t perform that action at this time.