Goby v2
test.proto
1 
2 import "dccl/option_extensions.proto";
3 
4 enum Enum1
5 {
6  ENUM_A = 1;
7  ENUM_B = 2;
8  ENUM_C = 3;
9 }
10 
11 message EmbeddedMsg1
12 {
13  optional double val = 1 [
14  (dccl.field).min = 0,
15  (dccl.field).max = 126,
16  (dccl.field).precision = 3
17  ];
18  optional EmbeddedMsg2 msg = 2;
19 }
20 
21 message EmbeddedMsg2
22 {
23  optional double val = 1 [
24  (dccl.field).min = 0,
25  (dccl.field).max = 126,
26  (dccl.field).precision = 2
27  ];
28  optional string sval = 2 [(dccl.field).max_length = 10];
29  optional Enum1 enum_default = 3;
30 }
31 
32 message TestMsg
33 {
34  option (dccl.msg).id = 2;
35  option (dccl.msg).max_bytes = 512;
36 
37  // test default enc/dec
38  optional double double_default_optional = 1 [
39  (dccl.field).min = -100,
40  (dccl.field).max = 126,
41  (dccl.field).precision = 2,
42  (dccl.field).in_head = true
43  ];
44  optional float float_default_optional = 2 [
45  (dccl.field).min = -20,
46  (dccl.field).max = 150,
47  (dccl.field).precision = 3
48  ];
49  optional int32 int32_default_optional = 3
50  [(dccl.field).min = -20, (dccl.field).max = 3000];
51  optional int64 int64_default_optional = 4
52  [(dccl.field).min = -710, (dccl.field).max = 3000];
53  optional uint32 uint32_default_optional = 5
54  [(dccl.field).min = 0, (dccl.field).max = 3000];
55  optional uint64 uint64_default_optional = 6
56  [(dccl.field).min = 5, (dccl.field).max = 3000];
57  optional sint32 sint32_default_optional = 7
58  [(dccl.field).min = -60, (dccl.field).max = 3000];
59  optional sint64 sint64_default_optional = 8
60  [(dccl.field).min = -70, (dccl.field).max = 3000];
61  optional fixed32 fixed32_default_optional = 9
62  [(dccl.field).min = 0, (dccl.field).max = 400];
63  optional fixed64 fixed64_default_optional = 10
64  [(dccl.field).min = 0, (dccl.field).max = 3000];
65  optional sfixed32 sfixed32_default_optional = 11
66  [(dccl.field).min = 11, (dccl.field).max = 3000];
67  optional sfixed64 sfixed64_default_optional = 12
68  [(dccl.field).min = -12, (dccl.field).max = 3000];
69 
70  optional bool bool_default_optional = 13;
71 
72  optional string string_default_optional = 14 [(dccl.field).max_length = 8];
73  optional bytes bytes_default_optional = 15 [(dccl.field).max_length = 9];
74 
75  optional Enum1 enum_default_optional = 16;
76 
77  optional EmbeddedMsg1 msg_default_optional = 17;
78 
79  required double double_default_required = 21 [
80  (dccl.field).min = -100,
81  (dccl.field).max = 126,
82  (dccl.field).precision = 2,
83  (dccl.field).in_head = true
84  ];
85  required float float_default_required = 22 [
86  (dccl.field).min = -20,
87  (dccl.field).max = 150,
88  (dccl.field).precision = 3
89  ];
90  required int32 int32_default_required = 23
91  [(dccl.field).min = -20, (dccl.field).max = 3000];
92  required int64 int64_default_required = 24
93  [(dccl.field).min = -710, (dccl.field).max = 3000];
94  required uint32 uint32_default_required = 25
95  [(dccl.field).min = 0, (dccl.field).max = 3000];
96  required uint64 uint64_default_required = 26
97  [(dccl.field).min = 5, (dccl.field).max = 3000];
98  required sint32 sint32_default_required = 27
99  [(dccl.field).min = -60, (dccl.field).max = 3000];
100  required sint64 sint64_default_required = 28
101  [(dccl.field).min = -70, (dccl.field).max = 3000];
102  required fixed32 fixed32_default_required = 29
103  [(dccl.field).min = 0, (dccl.field).max = 400];
104  required fixed64 fixed64_default_required = 30
105  [(dccl.field).min = 0, (dccl.field).max = 3000];
106  required sfixed32 sfixed32_default_required = 31
107  [(dccl.field).min = 11, (dccl.field).max = 3000];
108  required sfixed64 sfixed64_default_required = 32
109  [(dccl.field).min = -120, (dccl.field).max = 3000];
110 
111  required bool bool_default_required = 33;
112 
113  required string string_default_required = 34 [(dccl.field).max_length = 8];
114  required bytes bytes_default_required = 35 [(dccl.field).max_length = 9];
115 
116  required Enum1 enum_default_required = 36;
117 
118  required EmbeddedMsg1 msg_default_required = 37;
119 
120  repeated double double_default_repeat = 101 [
121  (dccl.field).min = 0,
122  (dccl.field).max = 100,
123  (dccl.field).precision = 3,
124  (dccl.field).max_repeat = 4
125  ];
126  repeated float float_default_repeat = 102 [
127  (dccl.field).min = 0,
128  (dccl.field).max = 100,
129  (dccl.field).precision = 3,
130  (dccl.field).max_repeat = 4
131  ];
132 
133  repeated int32 int32_default_repeat = 103 [
134  (dccl.field).min = 0,
135  (dccl.field).max = 100,
136  (dccl.field).max_repeat = 4
137  ];
138  repeated int64 int64_default_repeat = 104 [
139  (dccl.field).min = -100,
140  (dccl.field).max = 100,
141  (dccl.field).max_repeat = 4
142  ];
143  repeated uint32 uint32_default_repeat = 105 [
144  (dccl.field).min = 0,
145  (dccl.field).max = 100,
146  (dccl.field).max_repeat = 4,
147  (dccl.field).in_head = true
148  ];
149  repeated uint64 uint64_default_repeat = 106 [
150  (dccl.field).min = 0,
151  (dccl.field).max = 100,
152  (dccl.field).max_repeat = 4
153  ];
154  repeated sint32 sint32_default_repeat = 107 [
155  (dccl.field).min = -60,
156  (dccl.field).max = 100,
157  (dccl.field).max_repeat = 4
158  ];
159  repeated sint64 sint64_default_repeat = 108 [
160  (dccl.field).min = -600,
161  (dccl.field).max = 100,
162  (dccl.field).max_repeat = 4
163  ];
164  repeated fixed32 fixed32_default_repeat = 109 [
165  (dccl.field).min = 0,
166  (dccl.field).max = 100,
167  (dccl.field).max_repeat = 4
168  ];
169  repeated fixed64 fixed64_default_repeat = 110 [
170  (dccl.field).min = 0,
171  (dccl.field).max = 100,
172  (dccl.field).max_repeat = 4
173  ];
174  repeated sfixed32 sfixed32_default_repeat = 111 [
175  (dccl.field).min = 0,
176  (dccl.field).max = 100,
177  (dccl.field).max_repeat = 4
178  ];
179  repeated sfixed64 sfixed64_default_repeat = 112 [
180  (dccl.field).min = -500,
181  (dccl.field).max = 100,
182  (dccl.field).max_repeat = 4
183  ];
184 
185  repeated bool bool_default_repeat = 113 [(dccl.field).max_repeat = 4];
186 
187  repeated string string_default_repeat = 114
188  [(dccl.field).max_length = 4, (dccl.field).max_repeat = 4];
189  repeated bytes bytes_default_repeat = 115
190  [(dccl.field).max_length = 4, (dccl.field).max_repeat = 4];
191 
192  repeated Enum1 enum_default_repeat = 116 [(dccl.field).max_repeat = 4];
193 
194  repeated EmbeddedMsg1 msg_default_repeat = 117
195  [(dccl.field).max_repeat = 4];
196 }