如何共享gRPC的Protobuf定义? [英] How to share Protobuf definitions for gRPC?

查看:69
本文介绍了如何共享gRPC的Protobuf定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于必须共享.proto文件才能为gRPC定义数据和服务,因此服务提供者和客户端需要访问相同的.proto文件.有没有分发这些文件的通用策略?我要避免每个项目在其Git存储库中都有自己的.proto文件,而我们的团队成员需要手动编辑这些文件或通过电子邮件共享它们.

Since you have to share .proto files to define data and services for gRPC, service provider and clients need to access the same .proto files. Is there any common strategy to distribute these files? I want to avoid that every project has its own .proto file in its Git repository and our team members need to manual edit these files or share them via email.

有什么共同的最佳实践吗?

Is there any common best practice?

推荐答案

不幸的是,虽然您应该实现的主要目标是将原型文件存储在一个版本控制存储库中,但是没有惯例.

Unfortunately, there is no common practice, although the main goal that you should achieve is to store proto files in one version control repository.

在调查过程中,我发现了一些有关该主题的有趣博客文章:

During my investigation, I've found some interesting blog posts about that subject:

它们涵盖了gRPC工作流程的大部分注意事项.希望有帮助!

They covers much of gRPC workflow considerations. Hope that helps!

这篇关于如何共享gRPC的Protobuf定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆