blob: 681ad3050de0cfaa723e498d8c7bc77f2888bf68 [file] [log] [blame]
Rob Pikeb7907bf2012-02-13 14:25:20 +11001// Code generated by protoc-gen-go from "test.proto"
2// DO NOT EDIT!
3
4package testdata
5
6import proto "code.google.com/p/goprotobuf/proto"
David Symonds62539862012-08-04 10:06:55 +10007import "encoding/json"
Rob Pikeb7907bf2012-02-13 14:25:20 +11008import "math"
9
David Symonds62539862012-08-04 10:06:55 +100010// Reference proto, json, and math imports to suppress error if they are not otherwise used.
David Symonds0e084922012-07-02 16:04:40 -070011var _ = proto.Marshal
David Symonds62539862012-08-04 10:06:55 +100012var _ = &json.SyntaxError{}
Rob Pikeb7907bf2012-02-13 14:25:20 +110013var _ = math.Inf
14
15type FOO int32
16
17const (
18 FOO_FOO1 FOO = 1
19)
20
21var FOO_name = map[int32]string{
22 1: "FOO1",
23}
24var FOO_value = map[string]int32{
25 "FOO1": 1,
26}
27
David Symondsefeca9a2012-05-08 10:36:04 +100028func (x FOO) Enum() *FOO {
29 p := new(FOO)
30 *p = x
31 return p
32}
Rob Pikeb7907bf2012-02-13 14:25:20 +110033func (x FOO) String() string {
34 return proto.EnumName(FOO_name, int32(x))
35}
David Symonds62539862012-08-04 10:06:55 +100036func (x FOO) MarshalJSON() ([]byte, error) {
37 return json.Marshal(x.String())
38}
39func (x *FOO) UnmarshalJSON(data []byte) error {
40 value, err := proto.UnmarshalJSONEnum(FOO_value, data, "FOO")
41 if err != nil {
42 return err
43 }
44 *x = FOO(value)
45 return nil
46}
Rob Pikeb7907bf2012-02-13 14:25:20 +110047
48type GoTest_KIND int32
49
50const (
51 GoTest_VOID GoTest_KIND = 0
52 GoTest_BOOL GoTest_KIND = 1
53 GoTest_BYTES GoTest_KIND = 2
54 GoTest_FINGERPRINT GoTest_KIND = 3
55 GoTest_FLOAT GoTest_KIND = 4
56 GoTest_INT GoTest_KIND = 5
57 GoTest_STRING GoTest_KIND = 6
58 GoTest_TIME GoTest_KIND = 7
59 GoTest_TUPLE GoTest_KIND = 8
60 GoTest_ARRAY GoTest_KIND = 9
61 GoTest_MAP GoTest_KIND = 10
62 GoTest_TABLE GoTest_KIND = 11
63 GoTest_FUNCTION GoTest_KIND = 12
64)
65
66var GoTest_KIND_name = map[int32]string{
67 0: "VOID",
68 1: "BOOL",
69 2: "BYTES",
70 3: "FINGERPRINT",
71 4: "FLOAT",
72 5: "INT",
73 6: "STRING",
74 7: "TIME",
75 8: "TUPLE",
76 9: "ARRAY",
77 10: "MAP",
78 11: "TABLE",
79 12: "FUNCTION",
80}
81var GoTest_KIND_value = map[string]int32{
82 "VOID": 0,
83 "BOOL": 1,
84 "BYTES": 2,
85 "FINGERPRINT": 3,
86 "FLOAT": 4,
87 "INT": 5,
88 "STRING": 6,
89 "TIME": 7,
90 "TUPLE": 8,
91 "ARRAY": 9,
92 "MAP": 10,
93 "TABLE": 11,
94 "FUNCTION": 12,
95}
96
David Symondsefeca9a2012-05-08 10:36:04 +100097func (x GoTest_KIND) Enum() *GoTest_KIND {
98 p := new(GoTest_KIND)
99 *p = x
100 return p
101}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100102func (x GoTest_KIND) String() string {
103 return proto.EnumName(GoTest_KIND_name, int32(x))
104}
David Symonds62539862012-08-04 10:06:55 +1000105func (x GoTest_KIND) MarshalJSON() ([]byte, error) {
106 return json.Marshal(x.String())
107}
108func (x *GoTest_KIND) UnmarshalJSON(data []byte) error {
109 value, err := proto.UnmarshalJSONEnum(GoTest_KIND_value, data, "GoTest_KIND")
110 if err != nil {
111 return err
112 }
113 *x = GoTest_KIND(value)
114 return nil
115}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100116
117type MyMessage_Color int32
118
119const (
120 MyMessage_RED MyMessage_Color = 0
121 MyMessage_GREEN MyMessage_Color = 1
122 MyMessage_BLUE MyMessage_Color = 2
123)
124
125var MyMessage_Color_name = map[int32]string{
126 0: "RED",
127 1: "GREEN",
128 2: "BLUE",
129}
130var MyMessage_Color_value = map[string]int32{
131 "RED": 0,
132 "GREEN": 1,
133 "BLUE": 2,
134}
135
David Symondsefeca9a2012-05-08 10:36:04 +1000136func (x MyMessage_Color) Enum() *MyMessage_Color {
137 p := new(MyMessage_Color)
138 *p = x
139 return p
140}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100141func (x MyMessage_Color) String() string {
142 return proto.EnumName(MyMessage_Color_name, int32(x))
143}
David Symonds62539862012-08-04 10:06:55 +1000144func (x MyMessage_Color) MarshalJSON() ([]byte, error) {
145 return json.Marshal(x.String())
146}
147func (x *MyMessage_Color) UnmarshalJSON(data []byte) error {
148 value, err := proto.UnmarshalJSONEnum(MyMessage_Color_value, data, "MyMessage_Color")
149 if err != nil {
150 return err
151 }
152 *x = MyMessage_Color(value)
153 return nil
154}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100155
156type Defaults_Color int32
157
158const (
159 Defaults_RED Defaults_Color = 0
160 Defaults_GREEN Defaults_Color = 1
161 Defaults_BLUE Defaults_Color = 2
162)
163
164var Defaults_Color_name = map[int32]string{
165 0: "RED",
166 1: "GREEN",
167 2: "BLUE",
168}
169var Defaults_Color_value = map[string]int32{
170 "RED": 0,
171 "GREEN": 1,
172 "BLUE": 2,
173}
174
David Symondsefeca9a2012-05-08 10:36:04 +1000175func (x Defaults_Color) Enum() *Defaults_Color {
176 p := new(Defaults_Color)
177 *p = x
178 return p
179}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100180func (x Defaults_Color) String() string {
181 return proto.EnumName(Defaults_Color_name, int32(x))
182}
David Symonds62539862012-08-04 10:06:55 +1000183func (x Defaults_Color) MarshalJSON() ([]byte, error) {
184 return json.Marshal(x.String())
185}
186func (x *Defaults_Color) UnmarshalJSON(data []byte) error {
187 value, err := proto.UnmarshalJSONEnum(Defaults_Color_value, data, "Defaults_Color")
188 if err != nil {
189 return err
190 }
191 *x = Defaults_Color(value)
192 return nil
193}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100194
195type RepeatedEnum_Color int32
196
197const (
198 RepeatedEnum_RED RepeatedEnum_Color = 1
199)
200
201var RepeatedEnum_Color_name = map[int32]string{
202 1: "RED",
203}
204var RepeatedEnum_Color_value = map[string]int32{
205 "RED": 1,
206}
207
David Symondsefeca9a2012-05-08 10:36:04 +1000208func (x RepeatedEnum_Color) Enum() *RepeatedEnum_Color {
209 p := new(RepeatedEnum_Color)
210 *p = x
211 return p
212}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100213func (x RepeatedEnum_Color) String() string {
214 return proto.EnumName(RepeatedEnum_Color_name, int32(x))
215}
David Symonds62539862012-08-04 10:06:55 +1000216func (x RepeatedEnum_Color) MarshalJSON() ([]byte, error) {
217 return json.Marshal(x.String())
218}
219func (x *RepeatedEnum_Color) UnmarshalJSON(data []byte) error {
220 value, err := proto.UnmarshalJSONEnum(RepeatedEnum_Color_value, data, "RepeatedEnum_Color")
221 if err != nil {
222 return err
223 }
224 *x = RepeatedEnum_Color(value)
225 return nil
226}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100227
228type GoEnum struct {
229 Foo *FOO `protobuf:"varint,1,req,name=foo,enum=testdata.FOO" json:"foo,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000230 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100231}
232
233func (this *GoEnum) Reset() { *this = GoEnum{} }
234func (this *GoEnum) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000235func (*GoEnum) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100236
David Symonds0e084922012-07-02 16:04:40 -0700237func (this *GoEnum) GetFoo() FOO {
238 if this != nil && this.Foo != nil {
239 return *this.Foo
240 }
241 return 0
242}
243
Rob Pikeb7907bf2012-02-13 14:25:20 +1100244type GoTestField struct {
245 Label *string `protobuf:"bytes,1,req" json:"Label,omitempty"`
246 Type *string `protobuf:"bytes,2,req" json:"Type,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000247 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100248}
249
250func (this *GoTestField) Reset() { *this = GoTestField{} }
251func (this *GoTestField) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000252func (*GoTestField) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100253
David Symonds0e084922012-07-02 16:04:40 -0700254func (this *GoTestField) GetLabel() string {
255 if this != nil && this.Label != nil {
256 return *this.Label
257 }
258 return ""
259}
260
261func (this *GoTestField) GetType() string {
262 if this != nil && this.Type != nil {
263 return *this.Type
264 }
265 return ""
266}
267
Rob Pikeb7907bf2012-02-13 14:25:20 +1100268type GoTest struct {
269 Kind *GoTest_KIND `protobuf:"varint,1,req,enum=testdata.GoTest_KIND" json:"Kind,omitempty"`
270 Table *string `protobuf:"bytes,2,opt" json:"Table,omitempty"`
271 Param *int32 `protobuf:"varint,3,opt" json:"Param,omitempty"`
272 RequiredField *GoTestField `protobuf:"bytes,4,req" json:"RequiredField,omitempty"`
273 RepeatedField []*GoTestField `protobuf:"bytes,5,rep" json:"RepeatedField,omitempty"`
274 OptionalField *GoTestField `protobuf:"bytes,6,opt" json:"OptionalField,omitempty"`
275 F_BoolRequired *bool `protobuf:"varint,10,req,name=F_Bool_required" json:"F_Bool_required,omitempty"`
276 F_Int32Required *int32 `protobuf:"varint,11,req,name=F_Int32_required" json:"F_Int32_required,omitempty"`
277 F_Int64Required *int64 `protobuf:"varint,12,req,name=F_Int64_required" json:"F_Int64_required,omitempty"`
278 F_Fixed32Required *uint32 `protobuf:"fixed32,13,req,name=F_Fixed32_required" json:"F_Fixed32_required,omitempty"`
279 F_Fixed64Required *uint64 `protobuf:"fixed64,14,req,name=F_Fixed64_required" json:"F_Fixed64_required,omitempty"`
280 F_Uint32Required *uint32 `protobuf:"varint,15,req,name=F_Uint32_required" json:"F_Uint32_required,omitempty"`
281 F_Uint64Required *uint64 `protobuf:"varint,16,req,name=F_Uint64_required" json:"F_Uint64_required,omitempty"`
282 F_FloatRequired *float32 `protobuf:"fixed32,17,req,name=F_Float_required" json:"F_Float_required,omitempty"`
283 F_DoubleRequired *float64 `protobuf:"fixed64,18,req,name=F_Double_required" json:"F_Double_required,omitempty"`
284 F_StringRequired *string `protobuf:"bytes,19,req,name=F_String_required" json:"F_String_required,omitempty"`
285 F_BytesRequired []byte `protobuf:"bytes,101,req,name=F_Bytes_required" json:"F_Bytes_required,omitempty"`
286 F_Sint32Required *int32 `protobuf:"zigzag32,102,req,name=F_Sint32_required" json:"F_Sint32_required,omitempty"`
287 F_Sint64Required *int64 `protobuf:"zigzag64,103,req,name=F_Sint64_required" json:"F_Sint64_required,omitempty"`
288 F_BoolRepeated []bool `protobuf:"varint,20,rep,name=F_Bool_repeated" json:"F_Bool_repeated,omitempty"`
289 F_Int32Repeated []int32 `protobuf:"varint,21,rep,name=F_Int32_repeated" json:"F_Int32_repeated,omitempty"`
290 F_Int64Repeated []int64 `protobuf:"varint,22,rep,name=F_Int64_repeated" json:"F_Int64_repeated,omitempty"`
291 F_Fixed32Repeated []uint32 `protobuf:"fixed32,23,rep,name=F_Fixed32_repeated" json:"F_Fixed32_repeated,omitempty"`
292 F_Fixed64Repeated []uint64 `protobuf:"fixed64,24,rep,name=F_Fixed64_repeated" json:"F_Fixed64_repeated,omitempty"`
293 F_Uint32Repeated []uint32 `protobuf:"varint,25,rep,name=F_Uint32_repeated" json:"F_Uint32_repeated,omitempty"`
294 F_Uint64Repeated []uint64 `protobuf:"varint,26,rep,name=F_Uint64_repeated" json:"F_Uint64_repeated,omitempty"`
295 F_FloatRepeated []float32 `protobuf:"fixed32,27,rep,name=F_Float_repeated" json:"F_Float_repeated,omitempty"`
296 F_DoubleRepeated []float64 `protobuf:"fixed64,28,rep,name=F_Double_repeated" json:"F_Double_repeated,omitempty"`
297 F_StringRepeated []string `protobuf:"bytes,29,rep,name=F_String_repeated" json:"F_String_repeated,omitempty"`
298 F_BytesRepeated [][]byte `protobuf:"bytes,201,rep,name=F_Bytes_repeated" json:"F_Bytes_repeated,omitempty"`
299 F_Sint32Repeated []int32 `protobuf:"zigzag32,202,rep,name=F_Sint32_repeated" json:"F_Sint32_repeated,omitempty"`
300 F_Sint64Repeated []int64 `protobuf:"zigzag64,203,rep,name=F_Sint64_repeated" json:"F_Sint64_repeated,omitempty"`
301 F_BoolOptional *bool `protobuf:"varint,30,opt,name=F_Bool_optional" json:"F_Bool_optional,omitempty"`
302 F_Int32Optional *int32 `protobuf:"varint,31,opt,name=F_Int32_optional" json:"F_Int32_optional,omitempty"`
303 F_Int64Optional *int64 `protobuf:"varint,32,opt,name=F_Int64_optional" json:"F_Int64_optional,omitempty"`
304 F_Fixed32Optional *uint32 `protobuf:"fixed32,33,opt,name=F_Fixed32_optional" json:"F_Fixed32_optional,omitempty"`
305 F_Fixed64Optional *uint64 `protobuf:"fixed64,34,opt,name=F_Fixed64_optional" json:"F_Fixed64_optional,omitempty"`
306 F_Uint32Optional *uint32 `protobuf:"varint,35,opt,name=F_Uint32_optional" json:"F_Uint32_optional,omitempty"`
307 F_Uint64Optional *uint64 `protobuf:"varint,36,opt,name=F_Uint64_optional" json:"F_Uint64_optional,omitempty"`
308 F_FloatOptional *float32 `protobuf:"fixed32,37,opt,name=F_Float_optional" json:"F_Float_optional,omitempty"`
309 F_DoubleOptional *float64 `protobuf:"fixed64,38,opt,name=F_Double_optional" json:"F_Double_optional,omitempty"`
310 F_StringOptional *string `protobuf:"bytes,39,opt,name=F_String_optional" json:"F_String_optional,omitempty"`
311 F_BytesOptional []byte `protobuf:"bytes,301,opt,name=F_Bytes_optional" json:"F_Bytes_optional,omitempty"`
312 F_Sint32Optional *int32 `protobuf:"zigzag32,302,opt,name=F_Sint32_optional" json:"F_Sint32_optional,omitempty"`
313 F_Sint64Optional *int64 `protobuf:"zigzag64,303,opt,name=F_Sint64_optional" json:"F_Sint64_optional,omitempty"`
314 F_BoolDefaulted *bool `protobuf:"varint,40,opt,name=F_Bool_defaulted,def=1" json:"F_Bool_defaulted,omitempty"`
315 F_Int32Defaulted *int32 `protobuf:"varint,41,opt,name=F_Int32_defaulted,def=32" json:"F_Int32_defaulted,omitempty"`
316 F_Int64Defaulted *int64 `protobuf:"varint,42,opt,name=F_Int64_defaulted,def=64" json:"F_Int64_defaulted,omitempty"`
317 F_Fixed32Defaulted *uint32 `protobuf:"fixed32,43,opt,name=F_Fixed32_defaulted,def=320" json:"F_Fixed32_defaulted,omitempty"`
318 F_Fixed64Defaulted *uint64 `protobuf:"fixed64,44,opt,name=F_Fixed64_defaulted,def=640" json:"F_Fixed64_defaulted,omitempty"`
319 F_Uint32Defaulted *uint32 `protobuf:"varint,45,opt,name=F_Uint32_defaulted,def=3200" json:"F_Uint32_defaulted,omitempty"`
320 F_Uint64Defaulted *uint64 `protobuf:"varint,46,opt,name=F_Uint64_defaulted,def=6400" json:"F_Uint64_defaulted,omitempty"`
321 F_FloatDefaulted *float32 `protobuf:"fixed32,47,opt,name=F_Float_defaulted,def=314159" json:"F_Float_defaulted,omitempty"`
322 F_DoubleDefaulted *float64 `protobuf:"fixed64,48,opt,name=F_Double_defaulted,def=271828" json:"F_Double_defaulted,omitempty"`
323 F_StringDefaulted *string `protobuf:"bytes,49,opt,name=F_String_defaulted,def=hello, \"world!\"\n" json:"F_String_defaulted,omitempty"`
324 F_BytesDefaulted []byte `protobuf:"bytes,401,opt,name=F_Bytes_defaulted,def=Bignose" json:"F_Bytes_defaulted,omitempty"`
325 F_Sint32Defaulted *int32 `protobuf:"zigzag32,402,opt,name=F_Sint32_defaulted,def=-32" json:"F_Sint32_defaulted,omitempty"`
326 F_Sint64Defaulted *int64 `protobuf:"zigzag64,403,opt,name=F_Sint64_defaulted,def=-64" json:"F_Sint64_defaulted,omitempty"`
327 F_BoolRepeatedPacked []bool `protobuf:"varint,50,rep,packed,name=F_Bool_repeated_packed" json:"F_Bool_repeated_packed,omitempty"`
328 F_Int32RepeatedPacked []int32 `protobuf:"varint,51,rep,packed,name=F_Int32_repeated_packed" json:"F_Int32_repeated_packed,omitempty"`
329 F_Int64RepeatedPacked []int64 `protobuf:"varint,52,rep,packed,name=F_Int64_repeated_packed" json:"F_Int64_repeated_packed,omitempty"`
330 F_Fixed32RepeatedPacked []uint32 `protobuf:"fixed32,53,rep,packed,name=F_Fixed32_repeated_packed" json:"F_Fixed32_repeated_packed,omitempty"`
331 F_Fixed64RepeatedPacked []uint64 `protobuf:"fixed64,54,rep,packed,name=F_Fixed64_repeated_packed" json:"F_Fixed64_repeated_packed,omitempty"`
332 F_Uint32RepeatedPacked []uint32 `protobuf:"varint,55,rep,packed,name=F_Uint32_repeated_packed" json:"F_Uint32_repeated_packed,omitempty"`
333 F_Uint64RepeatedPacked []uint64 `protobuf:"varint,56,rep,packed,name=F_Uint64_repeated_packed" json:"F_Uint64_repeated_packed,omitempty"`
334 F_FloatRepeatedPacked []float32 `protobuf:"fixed32,57,rep,packed,name=F_Float_repeated_packed" json:"F_Float_repeated_packed,omitempty"`
335 F_DoubleRepeatedPacked []float64 `protobuf:"fixed64,58,rep,packed,name=F_Double_repeated_packed" json:"F_Double_repeated_packed,omitempty"`
336 F_Sint32RepeatedPacked []int32 `protobuf:"zigzag32,502,rep,packed,name=F_Sint32_repeated_packed" json:"F_Sint32_repeated_packed,omitempty"`
337 F_Sint64RepeatedPacked []int64 `protobuf:"zigzag64,503,rep,packed,name=F_Sint64_repeated_packed" json:"F_Sint64_repeated_packed,omitempty"`
338 Requiredgroup *GoTest_RequiredGroup `protobuf:"group,70,req,name=RequiredGroup" json:"requiredgroup,omitempty"`
339 Repeatedgroup []*GoTest_RepeatedGroup `protobuf:"group,80,rep,name=RepeatedGroup" json:"repeatedgroup,omitempty"`
340 Optionalgroup *GoTest_OptionalGroup `protobuf:"group,90,opt,name=OptionalGroup" json:"optionalgroup,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000341 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100342}
343
344func (this *GoTest) Reset() { *this = GoTest{} }
345func (this *GoTest) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000346func (*GoTest) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100347
348const Default_GoTest_F_BoolDefaulted bool = true
349const Default_GoTest_F_Int32Defaulted int32 = 32
350const Default_GoTest_F_Int64Defaulted int64 = 64
351const Default_GoTest_F_Fixed32Defaulted uint32 = 320
352const Default_GoTest_F_Fixed64Defaulted uint64 = 640
353const Default_GoTest_F_Uint32Defaulted uint32 = 3200
354const Default_GoTest_F_Uint64Defaulted uint64 = 6400
355const Default_GoTest_F_FloatDefaulted float32 = 314159
356const Default_GoTest_F_DoubleDefaulted float64 = 271828
357const Default_GoTest_F_StringDefaulted string = "hello, \"world!\"\n"
358
359var Default_GoTest_F_BytesDefaulted []byte = []byte("Bignose")
360
361const Default_GoTest_F_Sint32Defaulted int32 = -32
362const Default_GoTest_F_Sint64Defaulted int64 = -64
363
David Symonds0e084922012-07-02 16:04:40 -0700364func (this *GoTest) GetKind() GoTest_KIND {
365 if this != nil && this.Kind != nil {
366 return *this.Kind
367 }
368 return 0
369}
370
371func (this *GoTest) GetTable() string {
372 if this != nil && this.Table != nil {
373 return *this.Table
374 }
375 return ""
376}
377
378func (this *GoTest) GetParam() int32 {
379 if this != nil && this.Param != nil {
380 return *this.Param
381 }
382 return 0
383}
384
385func (this *GoTest) GetRequiredField() *GoTestField {
386 if this != nil {
387 return this.RequiredField
388 }
389 return nil
390}
391
392func (this *GoTest) GetOptionalField() *GoTestField {
393 if this != nil {
394 return this.OptionalField
395 }
396 return nil
397}
398
399func (this *GoTest) GetF_BoolRequired() bool {
400 if this != nil && this.F_BoolRequired != nil {
401 return *this.F_BoolRequired
402 }
403 return false
404}
405
406func (this *GoTest) GetF_Int32Required() int32 {
407 if this != nil && this.F_Int32Required != nil {
408 return *this.F_Int32Required
409 }
410 return 0
411}
412
413func (this *GoTest) GetF_Int64Required() int64 {
414 if this != nil && this.F_Int64Required != nil {
415 return *this.F_Int64Required
416 }
417 return 0
418}
419
420func (this *GoTest) GetF_Fixed32Required() uint32 {
421 if this != nil && this.F_Fixed32Required != nil {
422 return *this.F_Fixed32Required
423 }
424 return 0
425}
426
427func (this *GoTest) GetF_Fixed64Required() uint64 {
428 if this != nil && this.F_Fixed64Required != nil {
429 return *this.F_Fixed64Required
430 }
431 return 0
432}
433
434func (this *GoTest) GetF_Uint32Required() uint32 {
435 if this != nil && this.F_Uint32Required != nil {
436 return *this.F_Uint32Required
437 }
438 return 0
439}
440
441func (this *GoTest) GetF_Uint64Required() uint64 {
442 if this != nil && this.F_Uint64Required != nil {
443 return *this.F_Uint64Required
444 }
445 return 0
446}
447
448func (this *GoTest) GetF_FloatRequired() float32 {
449 if this != nil && this.F_FloatRequired != nil {
450 return *this.F_FloatRequired
451 }
452 return 0
453}
454
455func (this *GoTest) GetF_DoubleRequired() float64 {
456 if this != nil && this.F_DoubleRequired != nil {
457 return *this.F_DoubleRequired
458 }
459 return 0
460}
461
462func (this *GoTest) GetF_StringRequired() string {
463 if this != nil && this.F_StringRequired != nil {
464 return *this.F_StringRequired
465 }
466 return ""
467}
468
469func (this *GoTest) GetF_BytesRequired() []byte {
470 if this != nil {
471 return this.F_BytesRequired
472 }
473 return nil
474}
475
476func (this *GoTest) GetF_Sint32Required() int32 {
477 if this != nil && this.F_Sint32Required != nil {
478 return *this.F_Sint32Required
479 }
480 return 0
481}
482
483func (this *GoTest) GetF_Sint64Required() int64 {
484 if this != nil && this.F_Sint64Required != nil {
485 return *this.F_Sint64Required
486 }
487 return 0
488}
489
490func (this *GoTest) GetF_BoolOptional() bool {
491 if this != nil && this.F_BoolOptional != nil {
492 return *this.F_BoolOptional
493 }
494 return false
495}
496
497func (this *GoTest) GetF_Int32Optional() int32 {
498 if this != nil && this.F_Int32Optional != nil {
499 return *this.F_Int32Optional
500 }
501 return 0
502}
503
504func (this *GoTest) GetF_Int64Optional() int64 {
505 if this != nil && this.F_Int64Optional != nil {
506 return *this.F_Int64Optional
507 }
508 return 0
509}
510
511func (this *GoTest) GetF_Fixed32Optional() uint32 {
512 if this != nil && this.F_Fixed32Optional != nil {
513 return *this.F_Fixed32Optional
514 }
515 return 0
516}
517
518func (this *GoTest) GetF_Fixed64Optional() uint64 {
519 if this != nil && this.F_Fixed64Optional != nil {
520 return *this.F_Fixed64Optional
521 }
522 return 0
523}
524
525func (this *GoTest) GetF_Uint32Optional() uint32 {
526 if this != nil && this.F_Uint32Optional != nil {
527 return *this.F_Uint32Optional
528 }
529 return 0
530}
531
532func (this *GoTest) GetF_Uint64Optional() uint64 {
533 if this != nil && this.F_Uint64Optional != nil {
534 return *this.F_Uint64Optional
535 }
536 return 0
537}
538
539func (this *GoTest) GetF_FloatOptional() float32 {
540 if this != nil && this.F_FloatOptional != nil {
541 return *this.F_FloatOptional
542 }
543 return 0
544}
545
546func (this *GoTest) GetF_DoubleOptional() float64 {
547 if this != nil && this.F_DoubleOptional != nil {
548 return *this.F_DoubleOptional
549 }
550 return 0
551}
552
553func (this *GoTest) GetF_StringOptional() string {
554 if this != nil && this.F_StringOptional != nil {
555 return *this.F_StringOptional
556 }
557 return ""
558}
559
560func (this *GoTest) GetF_BytesOptional() []byte {
561 if this != nil {
562 return this.F_BytesOptional
563 }
564 return nil
565}
566
567func (this *GoTest) GetF_Sint32Optional() int32 {
568 if this != nil && this.F_Sint32Optional != nil {
569 return *this.F_Sint32Optional
570 }
571 return 0
572}
573
574func (this *GoTest) GetF_Sint64Optional() int64 {
575 if this != nil && this.F_Sint64Optional != nil {
576 return *this.F_Sint64Optional
577 }
578 return 0
579}
580
581func (this *GoTest) GetF_BoolDefaulted() bool {
582 if this != nil && this.F_BoolDefaulted != nil {
583 return *this.F_BoolDefaulted
584 }
585 return Default_GoTest_F_BoolDefaulted
586}
587
588func (this *GoTest) GetF_Int32Defaulted() int32 {
589 if this != nil && this.F_Int32Defaulted != nil {
590 return *this.F_Int32Defaulted
591 }
592 return Default_GoTest_F_Int32Defaulted
593}
594
595func (this *GoTest) GetF_Int64Defaulted() int64 {
596 if this != nil && this.F_Int64Defaulted != nil {
597 return *this.F_Int64Defaulted
598 }
599 return Default_GoTest_F_Int64Defaulted
600}
601
602func (this *GoTest) GetF_Fixed32Defaulted() uint32 {
603 if this != nil && this.F_Fixed32Defaulted != nil {
604 return *this.F_Fixed32Defaulted
605 }
606 return Default_GoTest_F_Fixed32Defaulted
607}
608
609func (this *GoTest) GetF_Fixed64Defaulted() uint64 {
610 if this != nil && this.F_Fixed64Defaulted != nil {
611 return *this.F_Fixed64Defaulted
612 }
613 return Default_GoTest_F_Fixed64Defaulted
614}
615
616func (this *GoTest) GetF_Uint32Defaulted() uint32 {
617 if this != nil && this.F_Uint32Defaulted != nil {
618 return *this.F_Uint32Defaulted
619 }
620 return Default_GoTest_F_Uint32Defaulted
621}
622
623func (this *GoTest) GetF_Uint64Defaulted() uint64 {
624 if this != nil && this.F_Uint64Defaulted != nil {
625 return *this.F_Uint64Defaulted
626 }
627 return Default_GoTest_F_Uint64Defaulted
628}
629
630func (this *GoTest) GetF_FloatDefaulted() float32 {
631 if this != nil && this.F_FloatDefaulted != nil {
632 return *this.F_FloatDefaulted
633 }
634 return Default_GoTest_F_FloatDefaulted
635}
636
637func (this *GoTest) GetF_DoubleDefaulted() float64 {
638 if this != nil && this.F_DoubleDefaulted != nil {
639 return *this.F_DoubleDefaulted
640 }
641 return Default_GoTest_F_DoubleDefaulted
642}
643
644func (this *GoTest) GetF_StringDefaulted() string {
645 if this != nil && this.F_StringDefaulted != nil {
646 return *this.F_StringDefaulted
647 }
648 return Default_GoTest_F_StringDefaulted
649}
650
651func (this *GoTest) GetF_BytesDefaulted() []byte {
652 if this != nil && this.F_BytesDefaulted != nil {
653 return this.F_BytesDefaulted
654 }
655 return append([]byte(nil), Default_GoTest_F_BytesDefaulted...)
656}
657
658func (this *GoTest) GetF_Sint32Defaulted() int32 {
659 if this != nil && this.F_Sint32Defaulted != nil {
660 return *this.F_Sint32Defaulted
661 }
662 return Default_GoTest_F_Sint32Defaulted
663}
664
665func (this *GoTest) GetF_Sint64Defaulted() int64 {
666 if this != nil && this.F_Sint64Defaulted != nil {
667 return *this.F_Sint64Defaulted
668 }
669 return Default_GoTest_F_Sint64Defaulted
670}
671
672func (this *GoTest) GetRequiredgroup() *GoTest_RequiredGroup {
673 if this != nil {
674 return this.Requiredgroup
675 }
676 return nil
677}
678
679func (this *GoTest) GetOptionalgroup() *GoTest_OptionalGroup {
680 if this != nil {
681 return this.Optionalgroup
682 }
683 return nil
684}
685
Rob Pikeb7907bf2012-02-13 14:25:20 +1100686type GoTest_RequiredGroup struct {
687 RequiredField *string `protobuf:"bytes,71,req" json:"RequiredField,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000688 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100689}
690
691func (this *GoTest_RequiredGroup) Reset() { *this = GoTest_RequiredGroup{} }
692func (this *GoTest_RequiredGroup) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000693func (*GoTest_RequiredGroup) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100694
David Symonds0e084922012-07-02 16:04:40 -0700695func (this *GoTest_RequiredGroup) GetRequiredField() string {
696 if this != nil && this.RequiredField != nil {
697 return *this.RequiredField
698 }
699 return ""
700}
701
Rob Pikeb7907bf2012-02-13 14:25:20 +1100702type GoTest_RepeatedGroup struct {
703 RequiredField *string `protobuf:"bytes,81,req" json:"RequiredField,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000704 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100705}
706
707func (this *GoTest_RepeatedGroup) Reset() { *this = GoTest_RepeatedGroup{} }
708func (this *GoTest_RepeatedGroup) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000709func (*GoTest_RepeatedGroup) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100710
David Symonds0e084922012-07-02 16:04:40 -0700711func (this *GoTest_RepeatedGroup) GetRequiredField() string {
712 if this != nil && this.RequiredField != nil {
713 return *this.RequiredField
714 }
715 return ""
716}
717
Rob Pikeb7907bf2012-02-13 14:25:20 +1100718type GoTest_OptionalGroup struct {
719 RequiredField *string `protobuf:"bytes,91,req" json:"RequiredField,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000720 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100721}
722
723func (this *GoTest_OptionalGroup) Reset() { *this = GoTest_OptionalGroup{} }
724func (this *GoTest_OptionalGroup) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000725func (*GoTest_OptionalGroup) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100726
David Symonds0e084922012-07-02 16:04:40 -0700727func (this *GoTest_OptionalGroup) GetRequiredField() string {
728 if this != nil && this.RequiredField != nil {
729 return *this.RequiredField
730 }
731 return ""
732}
733
Rob Pikeb7907bf2012-02-13 14:25:20 +1100734type GoSkipTest struct {
735 SkipInt32 *int32 `protobuf:"varint,11,req,name=skip_int32" json:"skip_int32,omitempty"`
736 SkipFixed32 *uint32 `protobuf:"fixed32,12,req,name=skip_fixed32" json:"skip_fixed32,omitempty"`
737 SkipFixed64 *uint64 `protobuf:"fixed64,13,req,name=skip_fixed64" json:"skip_fixed64,omitempty"`
738 SkipString *string `protobuf:"bytes,14,req,name=skip_string" json:"skip_string,omitempty"`
739 Skipgroup *GoSkipTest_SkipGroup `protobuf:"group,15,req,name=SkipGroup" json:"skipgroup,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000740 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100741}
742
743func (this *GoSkipTest) Reset() { *this = GoSkipTest{} }
744func (this *GoSkipTest) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000745func (*GoSkipTest) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100746
David Symonds0e084922012-07-02 16:04:40 -0700747func (this *GoSkipTest) GetSkipInt32() int32 {
748 if this != nil && this.SkipInt32 != nil {
749 return *this.SkipInt32
750 }
751 return 0
752}
753
754func (this *GoSkipTest) GetSkipFixed32() uint32 {
755 if this != nil && this.SkipFixed32 != nil {
756 return *this.SkipFixed32
757 }
758 return 0
759}
760
761func (this *GoSkipTest) GetSkipFixed64() uint64 {
762 if this != nil && this.SkipFixed64 != nil {
763 return *this.SkipFixed64
764 }
765 return 0
766}
767
768func (this *GoSkipTest) GetSkipString() string {
769 if this != nil && this.SkipString != nil {
770 return *this.SkipString
771 }
772 return ""
773}
774
775func (this *GoSkipTest) GetSkipgroup() *GoSkipTest_SkipGroup {
776 if this != nil {
777 return this.Skipgroup
778 }
779 return nil
780}
781
Rob Pikeb7907bf2012-02-13 14:25:20 +1100782type GoSkipTest_SkipGroup struct {
783 GroupInt32 *int32 `protobuf:"varint,16,req,name=group_int32" json:"group_int32,omitempty"`
784 GroupString *string `protobuf:"bytes,17,req,name=group_string" json:"group_string,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000785 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100786}
787
788func (this *GoSkipTest_SkipGroup) Reset() { *this = GoSkipTest_SkipGroup{} }
789func (this *GoSkipTest_SkipGroup) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000790func (*GoSkipTest_SkipGroup) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100791
David Symonds0e084922012-07-02 16:04:40 -0700792func (this *GoSkipTest_SkipGroup) GetGroupInt32() int32 {
793 if this != nil && this.GroupInt32 != nil {
794 return *this.GroupInt32
795 }
796 return 0
797}
798
799func (this *GoSkipTest_SkipGroup) GetGroupString() string {
800 if this != nil && this.GroupString != nil {
801 return *this.GroupString
802 }
803 return ""
804}
805
Rob Pikeb7907bf2012-02-13 14:25:20 +1100806type NonPackedTest struct {
807 A []int32 `protobuf:"varint,1,rep,name=a" json:"a,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000808 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100809}
810
811func (this *NonPackedTest) Reset() { *this = NonPackedTest{} }
812func (this *NonPackedTest) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000813func (*NonPackedTest) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100814
815type PackedTest struct {
816 B []int32 `protobuf:"varint,1,rep,packed,name=b" json:"b,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000817 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100818}
819
820func (this *PackedTest) Reset() { *this = PackedTest{} }
821func (this *PackedTest) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000822func (*PackedTest) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100823
824type MaxTag struct {
825 LastField *string `protobuf:"bytes,536870911,opt,name=last_field" json:"last_field,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000826 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100827}
828
829func (this *MaxTag) Reset() { *this = MaxTag{} }
830func (this *MaxTag) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000831func (*MaxTag) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100832
David Symonds0e084922012-07-02 16:04:40 -0700833func (this *MaxTag) GetLastField() string {
834 if this != nil && this.LastField != nil {
835 return *this.LastField
836 }
837 return ""
838}
839
David Symonds10c93ba2012-08-04 16:38:08 +1000840type OldMessage struct {
841 Nested *OldMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"`
842 XXX_unrecognized []byte `json:"-"`
843}
844
845func (this *OldMessage) Reset() { *this = OldMessage{} }
846func (this *OldMessage) String() string { return proto.CompactTextString(this) }
847func (*OldMessage) ProtoMessage() {}
848
849func (this *OldMessage) GetNested() *OldMessage_Nested {
850 if this != nil {
851 return this.Nested
852 }
853 return nil
854}
855
856type OldMessage_Nested struct {
857 Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
858 XXX_unrecognized []byte `json:"-"`
859}
860
861func (this *OldMessage_Nested) Reset() { *this = OldMessage_Nested{} }
862func (this *OldMessage_Nested) String() string { return proto.CompactTextString(this) }
863func (*OldMessage_Nested) ProtoMessage() {}
864
865func (this *OldMessage_Nested) GetName() string {
866 if this != nil && this.Name != nil {
867 return *this.Name
868 }
869 return ""
870}
871
872type NewMessage struct {
873 Nested *NewMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"`
874 XXX_unrecognized []byte `json:"-"`
875}
876
877func (this *NewMessage) Reset() { *this = NewMessage{} }
878func (this *NewMessage) String() string { return proto.CompactTextString(this) }
879func (*NewMessage) ProtoMessage() {}
880
881func (this *NewMessage) GetNested() *NewMessage_Nested {
882 if this != nil {
883 return this.Nested
884 }
885 return nil
886}
887
888type NewMessage_Nested struct {
889 Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
890 FoodGroup *string `protobuf:"bytes,2,opt,name=food_group" json:"food_group,omitempty"`
891 XXX_unrecognized []byte `json:"-"`
892}
893
894func (this *NewMessage_Nested) Reset() { *this = NewMessage_Nested{} }
895func (this *NewMessage_Nested) String() string { return proto.CompactTextString(this) }
896func (*NewMessage_Nested) ProtoMessage() {}
897
898func (this *NewMessage_Nested) GetName() string {
899 if this != nil && this.Name != nil {
900 return *this.Name
901 }
902 return ""
903}
904
905func (this *NewMessage_Nested) GetFoodGroup() string {
906 if this != nil && this.FoodGroup != nil {
907 return *this.FoodGroup
908 }
909 return ""
910}
911
Rob Pikeb7907bf2012-02-13 14:25:20 +1100912type InnerMessage struct {
913 Host *string `protobuf:"bytes,1,req,name=host" json:"host,omitempty"`
914 Port *int32 `protobuf:"varint,2,opt,name=port,def=4000" json:"port,omitempty"`
915 Connected *bool `protobuf:"varint,3,opt,name=connected" json:"connected,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000916 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100917}
918
919func (this *InnerMessage) Reset() { *this = InnerMessage{} }
920func (this *InnerMessage) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000921func (*InnerMessage) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100922
923const Default_InnerMessage_Port int32 = 4000
924
David Symonds0e084922012-07-02 16:04:40 -0700925func (this *InnerMessage) GetHost() string {
926 if this != nil && this.Host != nil {
927 return *this.Host
928 }
929 return ""
930}
931
932func (this *InnerMessage) GetPort() int32 {
933 if this != nil && this.Port != nil {
934 return *this.Port
935 }
936 return Default_InnerMessage_Port
937}
938
939func (this *InnerMessage) GetConnected() bool {
940 if this != nil && this.Connected != nil {
941 return *this.Connected
942 }
943 return false
944}
945
Rob Pikeb7907bf2012-02-13 14:25:20 +1100946type OtherMessage struct {
947 Key *int64 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"`
948 Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
949 Weight *float32 `protobuf:"fixed32,3,opt,name=weight" json:"weight,omitempty"`
950 Inner *InnerMessage `protobuf:"bytes,4,opt,name=inner" json:"inner,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000951 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100952}
953
954func (this *OtherMessage) Reset() { *this = OtherMessage{} }
955func (this *OtherMessage) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000956func (*OtherMessage) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100957
David Symonds0e084922012-07-02 16:04:40 -0700958func (this *OtherMessage) GetKey() int64 {
959 if this != nil && this.Key != nil {
960 return *this.Key
961 }
962 return 0
963}
964
965func (this *OtherMessage) GetValue() []byte {
966 if this != nil {
967 return this.Value
968 }
969 return nil
970}
971
972func (this *OtherMessage) GetWeight() float32 {
973 if this != nil && this.Weight != nil {
974 return *this.Weight
975 }
976 return 0
977}
978
979func (this *OtherMessage) GetInner() *InnerMessage {
980 if this != nil {
981 return this.Inner
982 }
983 return nil
984}
985
Rob Pikeb7907bf2012-02-13 14:25:20 +1100986type MyMessage struct {
987 Count *int32 `protobuf:"varint,1,req,name=count" json:"count,omitempty"`
988 Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
989 Quote *string `protobuf:"bytes,3,opt,name=quote" json:"quote,omitempty"`
990 Pet []string `protobuf:"bytes,4,rep,name=pet" json:"pet,omitempty"`
991 Inner *InnerMessage `protobuf:"bytes,5,opt,name=inner" json:"inner,omitempty"`
992 Others []*OtherMessage `protobuf:"bytes,6,rep,name=others" json:"others,omitempty"`
993 Bikeshed *MyMessage_Color `protobuf:"varint,7,opt,name=bikeshed,enum=testdata.MyMessage_Color" json:"bikeshed,omitempty"`
994 Somegroup *MyMessage_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"`
995 RepBytes [][]byte `protobuf:"bytes,10,rep,name=rep_bytes" json:"rep_bytes,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000996 XXX_extensions map[int32]proto.Extension `json:"-"`
997 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100998}
999
1000func (this *MyMessage) Reset() { *this = MyMessage{} }
1001func (this *MyMessage) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001002func (*MyMessage) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001003
1004var extRange_MyMessage = []proto.ExtensionRange{
1005 {100, 536870911},
1006}
1007
1008func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange {
1009 return extRange_MyMessage
1010}
1011func (this *MyMessage) ExtensionMap() map[int32]proto.Extension {
1012 if this.XXX_extensions == nil {
1013 this.XXX_extensions = make(map[int32]proto.Extension)
1014 }
1015 return this.XXX_extensions
1016}
1017
David Symonds0e084922012-07-02 16:04:40 -07001018func (this *MyMessage) GetCount() int32 {
1019 if this != nil && this.Count != nil {
1020 return *this.Count
1021 }
1022 return 0
1023}
1024
1025func (this *MyMessage) GetName() string {
1026 if this != nil && this.Name != nil {
1027 return *this.Name
1028 }
1029 return ""
1030}
1031
1032func (this *MyMessage) GetQuote() string {
1033 if this != nil && this.Quote != nil {
1034 return *this.Quote
1035 }
1036 return ""
1037}
1038
1039func (this *MyMessage) GetInner() *InnerMessage {
1040 if this != nil {
1041 return this.Inner
1042 }
1043 return nil
1044}
1045
1046func (this *MyMessage) GetBikeshed() MyMessage_Color {
1047 if this != nil && this.Bikeshed != nil {
1048 return *this.Bikeshed
1049 }
1050 return 0
1051}
1052
1053func (this *MyMessage) GetSomegroup() *MyMessage_SomeGroup {
1054 if this != nil {
1055 return this.Somegroup
1056 }
1057 return nil
1058}
1059
Rob Pikeb7907bf2012-02-13 14:25:20 +11001060type MyMessage_SomeGroup struct {
1061 GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001062 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001063}
1064
1065func (this *MyMessage_SomeGroup) Reset() { *this = MyMessage_SomeGroup{} }
1066func (this *MyMessage_SomeGroup) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001067func (*MyMessage_SomeGroup) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001068
David Symonds0e084922012-07-02 16:04:40 -07001069func (this *MyMessage_SomeGroup) GetGroupField() int32 {
1070 if this != nil && this.GroupField != nil {
1071 return *this.GroupField
1072 }
1073 return 0
1074}
1075
Rob Pikeb7907bf2012-02-13 14:25:20 +11001076type Ext struct {
1077 Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001078 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001079}
1080
1081func (this *Ext) Reset() { *this = Ext{} }
1082func (this *Ext) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001083func (*Ext) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001084
David Symonds0e084922012-07-02 16:04:40 -07001085func (this *Ext) GetData() string {
1086 if this != nil && this.Data != nil {
1087 return *this.Data
1088 }
1089 return ""
1090}
1091
Rob Pikeb7907bf2012-02-13 14:25:20 +11001092var E_Ext_More = &proto.ExtensionDesc{
1093 ExtendedType: (*MyMessage)(nil),
1094 ExtensionType: (*Ext)(nil),
1095 Field: 103,
1096 Name: "testdata.Ext.more",
1097 Tag: "bytes,103,opt,name=more",
1098}
1099
1100var E_Ext_Text = &proto.ExtensionDesc{
1101 ExtendedType: (*MyMessage)(nil),
1102 ExtensionType: (*string)(nil),
1103 Field: 104,
1104 Name: "testdata.Ext.text",
1105 Tag: "bytes,104,opt,name=text",
1106}
1107
1108var E_Ext_Number = &proto.ExtensionDesc{
1109 ExtendedType: (*MyMessage)(nil),
1110 ExtensionType: (*int32)(nil),
1111 Field: 105,
1112 Name: "testdata.Ext.number",
1113 Tag: "varint,105,opt,name=number",
1114}
1115
1116type MessageList struct {
1117 Message []*MessageList_Message `protobuf:"group,1,rep" json:"message,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001118 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001119}
1120
1121func (this *MessageList) Reset() { *this = MessageList{} }
1122func (this *MessageList) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001123func (*MessageList) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001124
1125type MessageList_Message struct {
1126 Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"`
1127 Count *int32 `protobuf:"varint,3,req,name=count" json:"count,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001128 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001129}
1130
1131func (this *MessageList_Message) Reset() { *this = MessageList_Message{} }
1132func (this *MessageList_Message) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001133func (*MessageList_Message) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001134
David Symonds0e084922012-07-02 16:04:40 -07001135func (this *MessageList_Message) GetName() string {
1136 if this != nil && this.Name != nil {
1137 return *this.Name
1138 }
1139 return ""
1140}
1141
1142func (this *MessageList_Message) GetCount() int32 {
1143 if this != nil && this.Count != nil {
1144 return *this.Count
1145 }
1146 return 0
1147}
1148
Rob Pikeb7907bf2012-02-13 14:25:20 +11001149type Strings struct {
1150 StringField *string `protobuf:"bytes,1,opt,name=string_field" json:"string_field,omitempty"`
1151 BytesField []byte `protobuf:"bytes,2,opt,name=bytes_field" json:"bytes_field,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001152 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001153}
1154
1155func (this *Strings) Reset() { *this = Strings{} }
1156func (this *Strings) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001157func (*Strings) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001158
David Symonds0e084922012-07-02 16:04:40 -07001159func (this *Strings) GetStringField() string {
1160 if this != nil && this.StringField != nil {
1161 return *this.StringField
1162 }
1163 return ""
1164}
1165
1166func (this *Strings) GetBytesField() []byte {
1167 if this != nil {
1168 return this.BytesField
1169 }
1170 return nil
1171}
1172
Rob Pikeb7907bf2012-02-13 14:25:20 +11001173type Defaults struct {
1174 F_Bool *bool `protobuf:"varint,1,opt,def=1" json:"F_Bool,omitempty"`
1175 F_Int32 *int32 `protobuf:"varint,2,opt,def=32" json:"F_Int32,omitempty"`
1176 F_Int64 *int64 `protobuf:"varint,3,opt,def=64" json:"F_Int64,omitempty"`
1177 F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,def=320" json:"F_Fixed32,omitempty"`
1178 F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,def=640" json:"F_Fixed64,omitempty"`
1179 F_Uint32 *uint32 `protobuf:"varint,6,opt,def=3200" json:"F_Uint32,omitempty"`
1180 F_Uint64 *uint64 `protobuf:"varint,7,opt,def=6400" json:"F_Uint64,omitempty"`
1181 F_Float *float32 `protobuf:"fixed32,8,opt,def=314159" json:"F_Float,omitempty"`
1182 F_Double *float64 `protobuf:"fixed64,9,opt,def=271828" json:"F_Double,omitempty"`
1183 F_String *string `protobuf:"bytes,10,opt,def=hello, \"world!\"\n" json:"F_String,omitempty"`
1184 F_Bytes []byte `protobuf:"bytes,11,opt,def=Bignose" json:"F_Bytes,omitempty"`
1185 F_Sint32 *int32 `protobuf:"zigzag32,12,opt,def=-32" json:"F_Sint32,omitempty"`
1186 F_Sint64 *int64 `protobuf:"zigzag64,13,opt,def=-64" json:"F_Sint64,omitempty"`
1187 F_Enum *Defaults_Color `protobuf:"varint,14,opt,enum=testdata.Defaults_Color,def=1" json:"F_Enum,omitempty"`
1188 F_Pinf *float32 `protobuf:"fixed32,15,opt,def=inf" json:"F_Pinf,omitempty"`
1189 F_Ninf *float32 `protobuf:"fixed32,16,opt,def=-inf" json:"F_Ninf,omitempty"`
1190 F_Nan *float32 `protobuf:"fixed32,17,opt,def=nan" json:"F_Nan,omitempty"`
1191 Sub *SubDefaults `protobuf:"bytes,18,opt,name=sub" json:"sub,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001192 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001193}
1194
1195func (this *Defaults) Reset() { *this = Defaults{} }
1196func (this *Defaults) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001197func (*Defaults) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001198
1199const Default_Defaults_F_Bool bool = true
1200const Default_Defaults_F_Int32 int32 = 32
1201const Default_Defaults_F_Int64 int64 = 64
1202const Default_Defaults_F_Fixed32 uint32 = 320
1203const Default_Defaults_F_Fixed64 uint64 = 640
1204const Default_Defaults_F_Uint32 uint32 = 3200
1205const Default_Defaults_F_Uint64 uint64 = 6400
1206const Default_Defaults_F_Float float32 = 314159
1207const Default_Defaults_F_Double float64 = 271828
1208const Default_Defaults_F_String string = "hello, \"world!\"\n"
1209
1210var Default_Defaults_F_Bytes []byte = []byte("Bignose")
1211
1212const Default_Defaults_F_Sint32 int32 = -32
1213const Default_Defaults_F_Sint64 int64 = -64
1214const Default_Defaults_F_Enum Defaults_Color = Defaults_GREEN
1215
1216var Default_Defaults_F_Pinf float32 = float32(math.Inf(1))
1217var Default_Defaults_F_Ninf float32 = float32(math.Inf(-1))
1218var Default_Defaults_F_Nan float32 = float32(math.NaN())
1219
David Symonds0e084922012-07-02 16:04:40 -07001220func (this *Defaults) GetF_Bool() bool {
1221 if this != nil && this.F_Bool != nil {
1222 return *this.F_Bool
1223 }
1224 return Default_Defaults_F_Bool
1225}
1226
1227func (this *Defaults) GetF_Int32() int32 {
1228 if this != nil && this.F_Int32 != nil {
1229 return *this.F_Int32
1230 }
1231 return Default_Defaults_F_Int32
1232}
1233
1234func (this *Defaults) GetF_Int64() int64 {
1235 if this != nil && this.F_Int64 != nil {
1236 return *this.F_Int64
1237 }
1238 return Default_Defaults_F_Int64
1239}
1240
1241func (this *Defaults) GetF_Fixed32() uint32 {
1242 if this != nil && this.F_Fixed32 != nil {
1243 return *this.F_Fixed32
1244 }
1245 return Default_Defaults_F_Fixed32
1246}
1247
1248func (this *Defaults) GetF_Fixed64() uint64 {
1249 if this != nil && this.F_Fixed64 != nil {
1250 return *this.F_Fixed64
1251 }
1252 return Default_Defaults_F_Fixed64
1253}
1254
1255func (this *Defaults) GetF_Uint32() uint32 {
1256 if this != nil && this.F_Uint32 != nil {
1257 return *this.F_Uint32
1258 }
1259 return Default_Defaults_F_Uint32
1260}
1261
1262func (this *Defaults) GetF_Uint64() uint64 {
1263 if this != nil && this.F_Uint64 != nil {
1264 return *this.F_Uint64
1265 }
1266 return Default_Defaults_F_Uint64
1267}
1268
1269func (this *Defaults) GetF_Float() float32 {
1270 if this != nil && this.F_Float != nil {
1271 return *this.F_Float
1272 }
1273 return Default_Defaults_F_Float
1274}
1275
1276func (this *Defaults) GetF_Double() float64 {
1277 if this != nil && this.F_Double != nil {
1278 return *this.F_Double
1279 }
1280 return Default_Defaults_F_Double
1281}
1282
1283func (this *Defaults) GetF_String() string {
1284 if this != nil && this.F_String != nil {
1285 return *this.F_String
1286 }
1287 return Default_Defaults_F_String
1288}
1289
1290func (this *Defaults) GetF_Bytes() []byte {
1291 if this != nil && this.F_Bytes != nil {
1292 return this.F_Bytes
1293 }
1294 return append([]byte(nil), Default_Defaults_F_Bytes...)
1295}
1296
1297func (this *Defaults) GetF_Sint32() int32 {
1298 if this != nil && this.F_Sint32 != nil {
1299 return *this.F_Sint32
1300 }
1301 return Default_Defaults_F_Sint32
1302}
1303
1304func (this *Defaults) GetF_Sint64() int64 {
1305 if this != nil && this.F_Sint64 != nil {
1306 return *this.F_Sint64
1307 }
1308 return Default_Defaults_F_Sint64
1309}
1310
1311func (this *Defaults) GetF_Enum() Defaults_Color {
1312 if this != nil && this.F_Enum != nil {
1313 return *this.F_Enum
1314 }
1315 return Default_Defaults_F_Enum
1316}
1317
1318func (this *Defaults) GetF_Pinf() float32 {
1319 if this != nil && this.F_Pinf != nil {
1320 return *this.F_Pinf
1321 }
1322 return Default_Defaults_F_Pinf
1323}
1324
1325func (this *Defaults) GetF_Ninf() float32 {
1326 if this != nil && this.F_Ninf != nil {
1327 return *this.F_Ninf
1328 }
1329 return Default_Defaults_F_Ninf
1330}
1331
1332func (this *Defaults) GetF_Nan() float32 {
1333 if this != nil && this.F_Nan != nil {
1334 return *this.F_Nan
1335 }
1336 return Default_Defaults_F_Nan
1337}
1338
1339func (this *Defaults) GetSub() *SubDefaults {
1340 if this != nil {
1341 return this.Sub
1342 }
1343 return nil
1344}
1345
Rob Pikeb7907bf2012-02-13 14:25:20 +11001346type SubDefaults struct {
1347 N *int64 `protobuf:"varint,1,opt,name=n,def=7" json:"n,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001348 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001349}
1350
1351func (this *SubDefaults) Reset() { *this = SubDefaults{} }
1352func (this *SubDefaults) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001353func (*SubDefaults) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001354
1355const Default_SubDefaults_N int64 = 7
1356
David Symonds0e084922012-07-02 16:04:40 -07001357func (this *SubDefaults) GetN() int64 {
1358 if this != nil && this.N != nil {
1359 return *this.N
1360 }
1361 return Default_SubDefaults_N
1362}
1363
Rob Pikeb7907bf2012-02-13 14:25:20 +11001364type RepeatedEnum struct {
1365 Color []RepeatedEnum_Color `protobuf:"varint,1,rep,name=color,enum=testdata.RepeatedEnum_Color" json:"color,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001366 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001367}
1368
1369func (this *RepeatedEnum) Reset() { *this = RepeatedEnum{} }
1370func (this *RepeatedEnum) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001371func (*RepeatedEnum) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001372
David Symonds61826da2012-05-05 09:31:28 +10001373var E_Greeting = &proto.ExtensionDesc{
1374 ExtendedType: (*MyMessage)(nil),
1375 ExtensionType: ([]string)(nil),
1376 Field: 106,
1377 Name: "testdata.greeting",
1378 Tag: "bytes,106,rep,name=greeting",
1379}
1380
Rob Pikeb7907bf2012-02-13 14:25:20 +11001381func init() {
1382 proto.RegisterEnum("testdata.FOO", FOO_name, FOO_value)
1383 proto.RegisterEnum("testdata.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value)
1384 proto.RegisterEnum("testdata.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value)
1385 proto.RegisterEnum("testdata.Defaults_Color", Defaults_Color_name, Defaults_Color_value)
1386 proto.RegisterEnum("testdata.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value)
1387 proto.RegisterExtension(E_Ext_More)
1388 proto.RegisterExtension(E_Ext_Text)
1389 proto.RegisterExtension(E_Ext_Number)
David Symonds61826da2012-05-05 09:31:28 +10001390 proto.RegisterExtension(E_Greeting)
Rob Pikeb7907bf2012-02-13 14:25:20 +11001391}