https://github.com/navono/go-grpc
A demo for grpc based golang
https://github.com/navono/go-grpc
golang grpc-go
Last synced: 22 days ago
JSON representation
A demo for grpc based golang
- Host: GitHub
- URL: https://github.com/navono/go-grpc
- Owner: navono
- License: mit
- Created: 2018-08-03T01:23:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-03T01:24:28.000Z (almost 8 years ago)
- Last Synced: 2025-03-11T18:54:57.928Z (over 1 year ago)
- Topics: golang, grpc-go
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-grpc
使用`golang`演示`grpc`的功能
# development
## 安装go插件
`grpc`依赖`protobuff3`,同时针对`golang`,还有一个`protobuff`的插件。因此需要安装以下模块:
- protobuff
- protoc-gen-go
- grpc
获取源码:
> go get -u github.com/golang/protobuf/protoc-gen-go
安装:
> go install github.com/golang/protobuf/protoc-gen-go
## 编译.proto文件
如果`GOPATH`的bin没有加入到环境变量:
> protoc --plugin=protoc-gen-go=$env:GOPATH\bin\protoc-gen-go.exe -I . helloworld.proto --go_out=.
如果加入了环境变量:
根目录下运行:
> protoc -I helloworld/ helloworld/helloworld.proto --go_out=plugins=grpc:helloworld
helloworld下运行:
> protoc -I helloworld/ helloworld.proto --go_out=plugins=grpc:helloworld
- dep ensure -add google.golang.org/grpc
- dep ensure -add github.com/golang/protobuf/protoc-gen-go