Go to file
Dawid Wysokiński c9ffd5e508
add comments
2023-05-10 08:31:14 +02:00
certs add mTLS 2023-05-03 07:24:27 +02:00
cmd update package name 2023-05-10 06:38:25 +02:00
internal/greeter update package name 2023-05-10 06:38:25 +02:00
proto add comments 2023-05-10 08:31:14 +02:00
.gitignore init 2023-05-02 09:19:35 +02:00
.golangci.yml init 2023-05-02 09:19:35 +02:00
README.md update package name 2023-05-10 06:38:25 +02:00
go.mod update package name 2023-05-10 06:38:25 +02:00
go.sum add tests 2023-05-07 07:01:56 +02:00

README.md

gRPC - demo

How to run it locally?

Prerequisites:

  • Go 1.19+
  • protoc
  • Go plugins for the protocol compiler:
    • go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.30.0
    • go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
  1. Clone this repo.
  2. cd ./grpc-demo
  3. Run go generate ./....
  4. Compile and execute the server code - go run ./cmd/server/main.go.
  5. From a different terminal, compile and execute the client code - go run ./cmd/client/main.go -example unary.

Client - available examples

  1. unary - example of the simplest type of RPC where the client sends a single request and gets back a single response. It's the default one.
  2. server - example of server streaming RPC.
  3. client - example of client streaming RPC.
  4. bidirectional - example of bidirectional streaming RPC.
  5. james - SayHelloToJames without error
  6. jameserror - error handling