p8_grpc/

directory
v0.0.0-...-63b2ac5 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: GPL-2.0

README

说明

教程
Github站点

获取例子
    $ go get -u github.com/grpc/grpc-go/examples/helloworld/greeter_client
    $ go get -u github.com/grpc/grpc-go/examples/helloworld/greeter_server

idea可以用使用插件Protobuf Support来方便编写protol-buffer文件

安装环境步骤
  1. 安装protobuf协议编译器github下载 protoc-3.8.0-linux-x86_64.zip 安装包

  2. 安装protobuf-go语言版编译插件 go get -u https://github.com/golang/protobuf.git 如果需要手动安装:

    git clone https://github.com/golang/protobuf.git ~/.GO/thirdPkg/src/golang.org/x/ && cd ~/.GO/thirdPkg/src/golang.org/x/protobuf/protoc-gen-go && go build . && go install
使用如下命令生成对应的代码 
```
    $ protoc --go_out=plugins=grpc:. p1_helloworld/proto/helloworld.proto
```
  1. 安装grpc-go 库 go get -u github.com/grpc/grpc-go 手动安装:
    cd ~/.GO/thirdPkg/src
    mkdir google.golang.org
    git clone https://github.com/grpc/grpc-go.git
    

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL