example/

directory
v0.0.0-...-1e08909 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT

README

迁移自grpc官方示例:google.golang.org/grpc/examples/route_guide

修改点:

  • 替换为本地生成的routeguide协议
  • RouteGuideServer替换为grpc-gateway-interceptor插件生成的RouteGuideWithInterceptor

Description

The route guide server and client demonstrate how to use grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs.

Please refer to gRPC Basics: Go for more information.

See the definition of the route guide service in routeguide/route_guide.proto.

Run the sample code

To compile and run the server, assuming you are in the root of the route_guide folder, i.e., .../examples/route_guide/, simply:

$ go run server/server.go

Likewise, to run the client:

$ go run client/client.go

Optional command line flags

The server and client both take optional command line flags. For example, the client and server run without TLS by default. To enable TLS:

$ go run server/server.go -tls=true

and

$ go run client/client.go -tls=true

Directories

Path Synopsis
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.
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