~bigbes/tarantool

tarantool-protobuf

ref: 4db0366a5008e874de1e26f690f4bff499de51bf tarantool-protobuf/test/proto/proto2_basic.proto -rw-r--r-- 873 bytes
4db0366a — Eugene Blikh runtime: parser + dynamic accept proto2 sources 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
syntax = "proto2";

package proto2_basic;

message Defaults {
  optional int32 i = 1 [default = 17];
  optional string s = 2 [default = "hello"];
  optional bool b = 3 [default = true];
  optional float f = 4 [default = 3.5];
  optional double d = 5 [default = 1.5];
  optional int64 i64 = 6 [default = 1234567890123];
  optional uint64 u64 = 7 [default = 17];
  optional bytes by = 8 [default = "\x00\xff"];
  optional Color color = 9 [default = GREEN];

  enum Color {
    RED = 0;
    GREEN = 1;
    BLUE = 2;
  }
}

message Cardinality {
  required int32 r = 1;
  optional int32 o = 2;
  repeated int32 packed_default = 3;
  repeated int32 explicitly_packed = 4 [packed = true];
  repeated int32 explicitly_unpacked = 5 [packed = false];
}

message Nested {
  required Inner inner = 1;
  optional Inner inner_opt = 2;

  message Inner {
    required int32 x = 1;
  }
}