protocol buffers指南----基本类型

Scalar值类型

基本消息字段可以有下列类型其中之一 - 下面的表格显示在.proto文件中指明的类型和在自动生成类中的相应类型。
下面是常用的类型示例:

.proto Type C++Type Go Type
double double float64
float float float32
int32 int int32
int32 int int32
int64 long int64
bool bool bool
string string string
bytes string []byte

参考:https://developers.google.com/protocol-buffers/docs/proto3#scalar

你可以在 Protocol Buffer Encoding 中找到更多资料, 了解当你序列化消息的时候, 这些类型是如何编码的.

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容