This is a sample gRPC / REST server written in Go.
It uses LabStack's Echo HTTP/2 server, instead of the built-in HTTP/2 server that comes
with Go's gRPC implementation.
This sample server demonstrates how to run both gRPC / REST. It also shows how to return
trailers headers for both gRPC and REST.
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
Go gRPC plugin for protoc
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
How to compile and run
If you made changes to the greeter.proto file, re-generate gRPC files.
Make sure you have all go, protoc, protoc-gen-go, and protoc-gen-go-grpc in your path.
go generate ./...
Compile the example hello-world.go
go build -o hello-world ./cmd/hello-world.go
This will produce a new binary hello-world in the current directory
Finally, you can run the example
PORT=80 ./hello-world
Sample gRPC Requests
Reflection
$ grpcurl -v -plaintext -proto ./pkg/greeter/greeter.proto localhost:80 list