- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
是否可以将 grpc 中 proto3
的默认模型从 CamelCase 更改为 snake_case?
例子:
文件 anyproto.proto
...
message Request {
bool RequestStatus = 1;
string RequestMessage = 2
}
...
现在 protoc -I。 --go_out=plugins=grpc:. anyproto.proto
命令生成这个模型:
文件:anyproto.pb.go
type Request struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RequestStatus bool `protobuf:"varint,1,opt,name=requestStatus,proto3" json:"requestStatus,omitempty"`
RequestMessage string `protobuf:"bytes,2,opt,name=requestMessage,proto3" json:"requestMessage,omitempty"`
}
我想将 requestStatus
和 requestMessage
的样式更改为 request_status
和 request_message
最佳答案
这是你要找的吗?
https://developers.google.com/protocol-buffers/docs/style#message_and_field_names
引用自链接:
Use CamelCase (with an initial capital) for message names – for example, SongServerRequest. Use underscore_separated_names for field names (including oneof field and extension names) – for example, song_name.
message SongServerRequest {
required string song_name = 1;
}
关于go - 由 grpc proto3 生成的 protobuff 中的蛇形格样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62873118/
我正在使用 protobuf-csharp-port 库以文本形式写入和读取消息。 我可以使用以下代码以文本形式编写消息,但我找不到任何示例来说明如何将此消息读回到原型(prototype) buff
在尝试使用以下命令编译名为 UserOptions.proto 的 proto 文件时,该文件具有名为 Account.proto 的导入 protoc --proto_path=/home/proj
考虑以下消息。 message example { repeated string text; } 假设在 C++ 中,我将一个字符串列表插入到示例的文本字段中: exemple aMessag
我正在研究从数据库中获取数据并构造 protobuff 消息的东西。鉴于可以从数据库中为某些字段获取空值的可能性,我将在尝试构造 protobuff 消息时得到空指针异常。从线程 http://cod
我遇到了错误 The type cannot be changed once a serializer has been generated 尝试使用 Protobuff.net 进行序列化时。我已设
我有一个 protoBuff3 规范,看起来像 message MSG { string name = 1; repeated string data = 2; } 还有一个设置“MSG.
自从我注意到 MapStruct 已更新以与 Protobuff 及其构建器交互,我考虑迁移我们的服务以完全使用 MapStruct。 然而,我们仍在编写到 protobuff 消息的手动转换,因为考
为什么 ProtoBuff.Net 不支持null? 我正在浏览 ProtoBuf,想知道为什么不支持 null 值。当我们尝试分配 null 值时,它给出了异常。即使像字符串这样的 ref 也不支持
我正在使用 Squareup Wire protobuf 生成 protobuf 类图书馆 这是我的原型(prototype)文件 syntax = "proto2"; package squareu
我正在实现一个自定义协议(protocol),两个应用程序将使用该协议(protocol)相互发送各种命令(包括文件传输,即大型二进制数据 block )。经过深思熟虑,我认为 protobuff 是
我创建了一个原型(prototype)插件。当我执行时: $ protoc --plugin=protoc-gen-grpc-java=grpc-client-guice-gradle-plugin
是否可以将 grpc 中 proto3 的默认模型从 CamelCase 更改为 snake_case? 例子: 文件 anyproto.proto ... message Request { b
总结:使用新的 tf.contrib.data.Dataset 使我的图形 protobuff 文件的大小加倍,我无法在 Tensorboard 中可视化图形。 详情: 我正在试用新的 TensorF
在阅读 Netty 教程时,我发现了一个简单的 description如何集成 Netty 和 Google Protocol Buffers .我已经开始研究它的示例(因为文档中没有更多信息)并编写
正在开发一个使用 ProtoBuff 获取其内容的项目。通过在 HTML 中加载 JavaScript 使其工作一次。现在重构为使用 requirejs 来加载脚本。但是当我尝试使用脚本时,它给出一个
我有一个简单的原型(prototype)文件,用于创建我的 java 类 syntax = "proto3"; option java_package = "some.project.grpc"; o
我正在调用一个 api 来获取输入流,然后调用静态方法 parseFrom(inputstream) 将其转换为 protobuffclass。 如果我用一个特定的类来做它会起作用: public C
我们有一个使用 google 实现的 java 后端表面原型(prototype)对象。我们现在想在客户端使用 .net 中的这些对象并对其进行操作。问题是我们不想在客户端依赖谷歌的不可变原型(pro
我是 c++ 和 visual studio 2012 的新手,所以问题可能出在屏幕和椅子之间。我执行了以下步骤; 我制作了一个带有选项 optimize_for = LITE_RUNTIME 的简单
使用 Protocol Buffer 对象(序列化为字节数组)在 Android Activity 之间作为 intent extras 传递而不是在经典 POJO 上实现 Parcelable 是个
我是一名优秀的程序员,十分优秀!