Protocol Buffers(持久化存储)

来源:互联网 发布:驾校预约考试软件 编辑:程序博客网 时间:2024/06/08 00:04

Protocol Buffers

Google Developer of Protocol Buffers


持久化的结果:

message Person {  required string name = 1;  required int32 id = 2;  optional string email = 3;}
  • Protocol Buffer里面的属性可以使基本的类型:比如 boolean,int ,string 等。
  • 每个message代表一类结构化数据
属性 含义 required 声明后,每个message的实例都需要有这个属性,例如我们的个人眼鼻子是必须的 optional 这个属性的取值可以为空,例如我们的外号是可有可无的 repeated 代表属性的取值可以是一个列表,例如我们的邮箱可以有多个

支持多种语言。

0 0
原创粉丝点击