This is a repository containing demos from this GRPC Golang course.
Forked from https://github.com/simplesteph/grpc-go-course.
- Greeting Service
- Calculator Service
- Unary, Server Streaming, Client Streaming, BiDi Streaming
- Error Handling, Deadlines, SSL Encryption
- Blog API CRUD w/ MongoDB
- Go.
- Protocol Buffers compiler (
protoc
).$ brew install protobuf
- Go plugins for
protoc
.$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.26 $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.1 $ export PATH="$PATH:$(go env GOPATH)/bin"
- Run the server.
make run-server
- Run the client.
make run-client
- Run the server.
make run-server-calc
- Run the client.
make run-client-calc
This one has several examples of gRPC APIs:
- Unary RPC: Sum and SquareRoot
- Client streaming: ComputeAverage
- Server streaming: PrimeNumberDecomposition
- Bidirectional streaming: FindMaximum
If you modify a .proto
file, you will need to recreate the generated files:
sh generate.sh