dongqun9403 2018-12-03 15:55
浏览 37

使用原始文件共享的外部软件包?

We have a few projects that depend on shared types to communicate. The teams have decided to use a shared package with those types, and would like to use protocol buffers for this implementation. If it matters, the language is Go, and all of these projects are not public.

How can we use protocol buffer types not defined within our project? I can't seem to find a way to share completely external types amongst applications. Everything I read tends to explain how to use sub-package .proto files but not types defined by another developer/team in another project within your project.

  • 写回答

2条回答 默认 最新

  • dtgr3392 2018-12-03 16:19
    关注

    You can use the protoc and specify the include path, as example:

    protoc -I/usr/local/include -I. \
    -I${GOPATH}/src \
    -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
    --go_out=$DST_DIR \ 
    my-proto.proto
    

    Hope this help

    评论

报告相同问题?

悬赏问题

  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100