美文网首页
grpc的go使用

grpc的go使用

作者: ahubaoan | 来源:发表于2018-07-18 10:05 被阅读0次

    安装

    $ go get -u google.golang.org/grpc
    

    获取 goprotobuf 提供的 Protobuf 编译器插件 protoc-gen-go

    $ go get github.com/golang/protobuf/protoc-gen-go
    

    一般安装在$GOBIN

    Build the example

    $ cd $GOPATH/src/google.golang.org/grpc/examples/helloworld
    

    gRPC服务在.proto文件中定义,该文件用于生成相应的.pb.go文件。 .pb.go文件是通过使用协议编译器编译.proto文件生成的:protoc。

    相关文章

      网友评论

          本文标题:grpc的go使用

          本文链接:https://www.haomeiwen.com/subject/tyknpftx.html