grpc-go 的安装和使用
grpc-go 安装
go get -u google.golang.org/grpc brew install automake
brew install libtool
brew install protobufgo get -u github.com/golang/protobuf/protoc-gen-goexport PATH=$PATH:$GOPATH/binvim helloworld.protosyntax = "proto3";
package protos;
// The greeting service definition.
service Hello {
// 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;
}
官方 example 运行
Last updated