hello_grpc

module
v0.0.0-...-7760e95 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2020 License: MIT

README

hello_grpc

grpc.png

gRPC's four kinds of service method in Go

4 kinds of service method

gRPC service method Request Response Example
Unary Single Single Greeting
Server-side streaming Single Stream File downloading
Client-side streaming Stream Single File uploading
Bidirectional streaming Stream Stream Shouting each other

1. Unary RPC

  • Client: Single request
  • Server: Single response

example - Greeting

2. Server-side streaming RPC

  • Client: Single request
  • Server: Stream response

example - Downloading data

3. Client-side streaming RPC

  • Client: Stream request
  • Server: Single response

example - Uploading file

4. Bidirectional streaming RPC

  • Client: Stream request
  • Server: Stream request

example - Shouting each other

Etc.

Appendix 1 - Tracing

example - Trace

Appendix 2 - Secure gRPC with TLS

  • Client: Secured ingle request
  • Server: Secured single response

example - TLS

Prerequisites

  1. Download Protocol Buffer and locate it in $GOPATH
  2. Install protoc-gen-go that is a plugin for the Google protocol buffer compiler to generate Go code.
go get -u github.com/golang/protobuf/protoc-gen-go

Directories

Path Synopsis
download
greeting
referee
tls
trace
upload

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL