examples/

directory
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: Apache-2.0

README

gRPC in 3 minutes (Go)

BACKGROUND

For this sample, we've already generated the server and client stubs from helloworld.proto.

PREREQUISITES

$ go help gopath
$ # ensure the PATH contains $GOPATH/bin
$ export PATH=$PATH:$GOPATH/bin

INSTALL

$ go get -u code.aliyun.com/yjkj.ink/grpc/examples/helloworld/greeter_client
$ go get -u code.aliyun.com/yjkj.ink/grpc/examples/helloworld/greeter_server

TRY IT!

  • Run the server

    $ greeter_server &
    
  • Run the client

    $ greeter_client
    

OPTIONAL - Rebuilding the generated code

  1. Install protobuf compiler

  2. Install the protoc Go plugin

    $ go get -u github.com/golang/protobuf/protoc-gen-go
    
  3. Rebuild the generated Go code

    $ go generate code.aliyun.com/yjkj.ink/grpc/examples/helloworld/...
    

    Or run protoc command (with the grpc plugin)

    $ protoc -I helloworld/ helloworld/helloworld.proto --go_out=plugins=grpc:helloworld
    

Directories

Path Synopsis
features
authentication/client command
The client demonstrates how to supply an OAuth2 token for every RPC.
The client demonstrates how to supply an OAuth2 token for every RPC.
authentication/server command
The server demonstrates how to consume and validate OAuth2 tokens provided by clients for each RPC.
The server demonstrates how to consume and validate OAuth2 tokens provided by clients for each RPC.
cancellation/client command
Binary client is an example client.
Binary client is an example client.
cancellation/server command
Binary server is an example server.
Binary server is an example server.
compression/client command
Binary client is an example client.
Binary client is an example client.
compression/server command
Binary server is an example server.
Binary server is an example server.
deadline/client command
Binary client is an example client.
Binary client is an example client.
deadline/server command
Binary server is an example server.
Binary server is an example server.
debugging/client command
Binary client is an example client.
Binary client is an example client.
debugging/server command
Binary server is an example server.
Binary server is an example server.
encryption/ALTS/client command
Binary client is an example client.
Binary client is an example client.
encryption/ALTS/server command
Binary server is an example server.
Binary server is an example server.
encryption/TLS/client command
Binary client is an example client.
Binary client is an example client.
encryption/TLS/server command
Binary server is an example server.
Binary server is an example server.
errors/client command
Binary client is an example client.
Binary client is an example client.
errors/server command
Binary server is an example server.
Binary server is an example server.
interceptor/client command
Binary client is an example client.
Binary client is an example client.
interceptor/server command
Binary server is an example server.
Binary server is an example server.
keepalive/client command
Binary client is an example client.
Binary client is an example client.
keepalive/server command
Binary server is an example server.
Binary server is an example server.
load_balancing/client command
Binary client is an example client.
Binary client is an example client.
load_balancing/server command
Binary server is an example server.
Binary server is an example server.
metadata/client command
Binary client is an example client.
Binary client is an example client.
metadata/server command
Binary server is an example server.
Binary server is an example server.
multiplex/client command
Binary client is an example client.
Binary client is an example client.
multiplex/server command
Binary server is an example server.
Binary server is an example server.
name_resolving/client command
Binary client is an example client.
Binary client is an example client.
name_resolving/server command
Binary server is an example server.
Binary server is an example server.
profiling/client command
Binary client is an example client.
Binary client is an example client.
profiling/server command
Binary server is an example server.
Binary server is an example server.
proto
Package proto is for go generate.
Package proto is for go generate.
reflection/server command
Binary server is an example server.
Binary server is an example server.
retry/client command
Binary client is an example client.
Binary client is an example client.
retry/server command
Binary server is an example server.
Binary server is an example server.
wait_for_ready command
Binary wait_for_ready is an example for "wait for ready".
Binary wait_for_ready is an example for "wait for ready".
xds/client command
Package main implements a client for Greeter service.
Package main implements a client for Greeter service.
xds/server command
Package main starts Greeter service that will response with the hostname.
Package main starts Greeter service that will response with the hostname.
greeter_client command
Package main implements a client for Greeter service.
Package main implements a client for Greeter service.
greeter_server command
Package main implements a server for Greeter service.
Package main implements a server for Greeter service.
route_guide
client command
Package main implements a simple gRPC client that demonstrates how to use gRPC-Go libraries to perform unary, client streaming, server streaming and full duplex RPCs.
Package main implements a simple gRPC client that demonstrates how to use gRPC-Go libraries to perform unary, client streaming, server streaming and full duplex RPCs.
server command
Package main implements a simple gRPC server that demonstrates how to use gRPC-Go libraries to perform unary, client streaming, server streaming and full duplex RPCs.
Package main implements a simple gRPC server that demonstrates how to use gRPC-Go libraries to perform unary, client streaming, server streaming and full duplex RPCs.

Jump to

Keyboard shortcuts

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