Protocol Buffers - Google's data interchange format (grpc依赖)
https://developers.google.com/protocol-buffers/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
42 lines
1.0 KiB
syntax = "proto3"; |
|
|
|
package upb.test.json; |
|
|
|
message TestMessage { |
|
int32 optional_int32 = 1; |
|
int64 optional_int64 = 2; |
|
int32 optional_uint32 = 3; |
|
int64 optional_uint64 = 4; |
|
string optional_string = 5; |
|
bytes optional_bytes = 6; |
|
bool optional_bool = 7; |
|
SubMessage optional_msg = 8; |
|
MyEnum optional_enum = 9; |
|
|
|
repeated int32 repeated_int32 = 11; |
|
repeated int64 repeated_int64 = 12; |
|
repeated uint32 repeated_uint32 = 13; |
|
repeated uint64 repeated_uint64 = 14; |
|
repeated string repeated_string = 15; |
|
repeated bytes repeated_bytes = 16; |
|
repeated bool repeated_bool = 17; |
|
repeated SubMessage repeated_msg = 18; |
|
repeated MyEnum repeated_enum = 19; |
|
|
|
map<string, string> map_string_string = 20; |
|
map<int32, string> map_int32_string = 21; |
|
map<bool, string> map_bool_string = 22; |
|
map<string, int32> map_string_int32 = 23; |
|
map<string, bool> map_string_bool = 24; |
|
map<string, SubMessage> map_string_msg = 25; |
|
} |
|
|
|
message SubMessage { |
|
int32 foo = 1; |
|
} |
|
|
|
enum MyEnum { |
|
A = 0; |
|
B = 1; |
|
C = 2; |
|
}
|
|
|