我想测试用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)