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