相关疑难解决方法(0)

测试gRPC服务

我想测试用Go编写的gRPC服务.我正在使用的示例是来自grpc-go repo的Hello World服务器示例.

protobuf的定义如下:

syntax = "proto3";

package helloworld;

// The greeting service definition.
service Greeter {
  // Sends a greeting
  rpc SayHello (HelloRequest) returns (HelloReply) {}
}

// The request message containing the user's name.
message HelloRequest {
  string name = 1;
}

// The response message containing the greetings
message HelloReply {
  string message = 1;
}
Run Code Online (Sandbox Code Playgroud)

greeter_server主要类型是:

// server is used to implement helloworld.GreeterServer.
type server struct{}

// SayHello implements helloworld.GreeterServer
func (s *server) …
Run Code Online (Sandbox Code Playgroud)

go grpc

31
推荐指数
6
解决办法
4万
查看次数

标签 统计

go ×1

grpc ×1