//旧版本写法
//package pb;
//新版本写法
option go_package = ".;pb";
message OtherStruct {
//保留字段
reserved 7;
//数组
repeated int32 array=1;
//嵌套message
ConcatRequest thisIsAnotherMsg=2;
//map
map<string,ConcatResponse> thisIsMap = 3;
//可选值
optional string thisIsOptionalVal=4;
//union
oneof likeUnion {
string opt1 = 5;
int32 opt2 = 6;
}
//保留字段
// string reserved=7;
//枚举
enum week {
Mon = 0;
Tue = 1;
Wen = 2;
}
}
在这里插入代码片
protobuf笔记
最新推荐文章于 2022-09-28 20:43:15 发布