blob: 67c3dc23e7508d0f9fa9bdfa7133bf4603c9c5c7 [file] [log] [blame]
David Symondsafbae882012-09-24 13:21:21 +10001// Code generated by protoc-gen-go.
2// source: test.proto
Rob Pikeb7907bf2012-02-13 14:25:20 +11003// DO NOT EDIT!
4
5package testdata
6
7import proto "code.google.com/p/goprotobuf/proto"
David Symondsafbae882012-09-24 13:21:21 +10008import json "encoding/json"
9import math "math"
Rob Pikeb7907bf2012-02-13 14:25:20 +110010
David Symonds62539862012-08-04 10:06:55 +100011// Reference proto, json, and math imports to suppress error if they are not otherwise used.
David Symonds0e084922012-07-02 16:04:40 -070012var _ = proto.Marshal
David Symonds62539862012-08-04 10:06:55 +100013var _ = &json.SyntaxError{}
Rob Pikeb7907bf2012-02-13 14:25:20 +110014var _ = math.Inf
15
16type FOO int32
17
18const (
19 FOO_FOO1 FOO = 1
20)
21
22var FOO_name = map[int32]string{
23 1: "FOO1",
24}
25var FOO_value = map[string]int32{
26 "FOO1": 1,
27}
28
David Symondsefeca9a2012-05-08 10:36:04 +100029func (x FOO) Enum() *FOO {
30 p := new(FOO)
31 *p = x
32 return p
33}
Rob Pikeb7907bf2012-02-13 14:25:20 +110034func (x FOO) String() string {
35 return proto.EnumName(FOO_name, int32(x))
36}
David Symonds62539862012-08-04 10:06:55 +100037func (x FOO) MarshalJSON() ([]byte, error) {
38 return json.Marshal(x.String())
39}
40func (x *FOO) UnmarshalJSON(data []byte) error {
41 value, err := proto.UnmarshalJSONEnum(FOO_value, data, "FOO")
42 if err != nil {
43 return err
44 }
45 *x = FOO(value)
46 return nil
47}
Rob Pikeb7907bf2012-02-13 14:25:20 +110048
49type GoTest_KIND int32
50
51const (
52 GoTest_VOID GoTest_KIND = 0
53 GoTest_BOOL GoTest_KIND = 1
54 GoTest_BYTES GoTest_KIND = 2
55 GoTest_FINGERPRINT GoTest_KIND = 3
56 GoTest_FLOAT GoTest_KIND = 4
57 GoTest_INT GoTest_KIND = 5
58 GoTest_STRING GoTest_KIND = 6
59 GoTest_TIME GoTest_KIND = 7
60 GoTest_TUPLE GoTest_KIND = 8
61 GoTest_ARRAY GoTest_KIND = 9
62 GoTest_MAP GoTest_KIND = 10
63 GoTest_TABLE GoTest_KIND = 11
64 GoTest_FUNCTION GoTest_KIND = 12
65)
66
67var GoTest_KIND_name = map[int32]string{
68 0: "VOID",
69 1: "BOOL",
70 2: "BYTES",
71 3: "FINGERPRINT",
72 4: "FLOAT",
73 5: "INT",
74 6: "STRING",
75 7: "TIME",
76 8: "TUPLE",
77 9: "ARRAY",
78 10: "MAP",
79 11: "TABLE",
80 12: "FUNCTION",
81}
82var GoTest_KIND_value = map[string]int32{
83 "VOID": 0,
84 "BOOL": 1,
85 "BYTES": 2,
86 "FINGERPRINT": 3,
87 "FLOAT": 4,
88 "INT": 5,
89 "STRING": 6,
90 "TIME": 7,
91 "TUPLE": 8,
92 "ARRAY": 9,
93 "MAP": 10,
94 "TABLE": 11,
95 "FUNCTION": 12,
96}
97
David Symondsefeca9a2012-05-08 10:36:04 +100098func (x GoTest_KIND) Enum() *GoTest_KIND {
99 p := new(GoTest_KIND)
100 *p = x
101 return p
102}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100103func (x GoTest_KIND) String() string {
104 return proto.EnumName(GoTest_KIND_name, int32(x))
105}
David Symonds62539862012-08-04 10:06:55 +1000106func (x GoTest_KIND) MarshalJSON() ([]byte, error) {
107 return json.Marshal(x.String())
108}
109func (x *GoTest_KIND) UnmarshalJSON(data []byte) error {
110 value, err := proto.UnmarshalJSONEnum(GoTest_KIND_value, data, "GoTest_KIND")
111 if err != nil {
112 return err
113 }
114 *x = GoTest_KIND(value)
115 return nil
116}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100117
118type MyMessage_Color int32
119
120const (
121 MyMessage_RED MyMessage_Color = 0
122 MyMessage_GREEN MyMessage_Color = 1
123 MyMessage_BLUE MyMessage_Color = 2
124)
125
126var MyMessage_Color_name = map[int32]string{
127 0: "RED",
128 1: "GREEN",
129 2: "BLUE",
130}
131var MyMessage_Color_value = map[string]int32{
132 "RED": 0,
133 "GREEN": 1,
134 "BLUE": 2,
135}
136
David Symondsefeca9a2012-05-08 10:36:04 +1000137func (x MyMessage_Color) Enum() *MyMessage_Color {
138 p := new(MyMessage_Color)
139 *p = x
140 return p
141}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100142func (x MyMessage_Color) String() string {
143 return proto.EnumName(MyMessage_Color_name, int32(x))
144}
David Symonds62539862012-08-04 10:06:55 +1000145func (x MyMessage_Color) MarshalJSON() ([]byte, error) {
146 return json.Marshal(x.String())
147}
148func (x *MyMessage_Color) UnmarshalJSON(data []byte) error {
149 value, err := proto.UnmarshalJSONEnum(MyMessage_Color_value, data, "MyMessage_Color")
150 if err != nil {
151 return err
152 }
153 *x = MyMessage_Color(value)
154 return nil
155}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100156
157type Defaults_Color int32
158
159const (
160 Defaults_RED Defaults_Color = 0
161 Defaults_GREEN Defaults_Color = 1
162 Defaults_BLUE Defaults_Color = 2
163)
164
165var Defaults_Color_name = map[int32]string{
166 0: "RED",
167 1: "GREEN",
168 2: "BLUE",
169}
170var Defaults_Color_value = map[string]int32{
171 "RED": 0,
172 "GREEN": 1,
173 "BLUE": 2,
174}
175
David Symondsefeca9a2012-05-08 10:36:04 +1000176func (x Defaults_Color) Enum() *Defaults_Color {
177 p := new(Defaults_Color)
178 *p = x
179 return p
180}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100181func (x Defaults_Color) String() string {
182 return proto.EnumName(Defaults_Color_name, int32(x))
183}
David Symonds62539862012-08-04 10:06:55 +1000184func (x Defaults_Color) MarshalJSON() ([]byte, error) {
185 return json.Marshal(x.String())
186}
187func (x *Defaults_Color) UnmarshalJSON(data []byte) error {
188 value, err := proto.UnmarshalJSONEnum(Defaults_Color_value, data, "Defaults_Color")
189 if err != nil {
190 return err
191 }
192 *x = Defaults_Color(value)
193 return nil
194}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100195
196type RepeatedEnum_Color int32
197
198const (
199 RepeatedEnum_RED RepeatedEnum_Color = 1
200)
201
202var RepeatedEnum_Color_name = map[int32]string{
203 1: "RED",
204}
205var RepeatedEnum_Color_value = map[string]int32{
206 "RED": 1,
207}
208
David Symondsefeca9a2012-05-08 10:36:04 +1000209func (x RepeatedEnum_Color) Enum() *RepeatedEnum_Color {
210 p := new(RepeatedEnum_Color)
211 *p = x
212 return p
213}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100214func (x RepeatedEnum_Color) String() string {
215 return proto.EnumName(RepeatedEnum_Color_name, int32(x))
216}
David Symonds62539862012-08-04 10:06:55 +1000217func (x RepeatedEnum_Color) MarshalJSON() ([]byte, error) {
218 return json.Marshal(x.String())
219}
220func (x *RepeatedEnum_Color) UnmarshalJSON(data []byte) error {
221 value, err := proto.UnmarshalJSONEnum(RepeatedEnum_Color_value, data, "RepeatedEnum_Color")
222 if err != nil {
223 return err
224 }
225 *x = RepeatedEnum_Color(value)
226 return nil
227}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100228
229type GoEnum struct {
230 Foo *FOO `protobuf:"varint,1,req,name=foo,enum=testdata.FOO" json:"foo,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000231 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100232}
233
234func (this *GoEnum) Reset() { *this = GoEnum{} }
235func (this *GoEnum) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000236func (*GoEnum) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100237
David Symonds0e084922012-07-02 16:04:40 -0700238func (this *GoEnum) GetFoo() FOO {
239 if this != nil && this.Foo != nil {
240 return *this.Foo
241 }
242 return 0
243}
244
Rob Pikeb7907bf2012-02-13 14:25:20 +1100245type GoTestField struct {
246 Label *string `protobuf:"bytes,1,req" json:"Label,omitempty"`
247 Type *string `protobuf:"bytes,2,req" json:"Type,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000248 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100249}
250
251func (this *GoTestField) Reset() { *this = GoTestField{} }
252func (this *GoTestField) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000253func (*GoTestField) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100254
David Symonds0e084922012-07-02 16:04:40 -0700255func (this *GoTestField) GetLabel() string {
256 if this != nil && this.Label != nil {
257 return *this.Label
258 }
259 return ""
260}
261
262func (this *GoTestField) GetType() string {
263 if this != nil && this.Type != nil {
264 return *this.Type
265 }
266 return ""
267}
268
Rob Pikeb7907bf2012-02-13 14:25:20 +1100269type GoTest struct {
270 Kind *GoTest_KIND `protobuf:"varint,1,req,enum=testdata.GoTest_KIND" json:"Kind,omitempty"`
271 Table *string `protobuf:"bytes,2,opt" json:"Table,omitempty"`
272 Param *int32 `protobuf:"varint,3,opt" json:"Param,omitempty"`
273 RequiredField *GoTestField `protobuf:"bytes,4,req" json:"RequiredField,omitempty"`
274 RepeatedField []*GoTestField `protobuf:"bytes,5,rep" json:"RepeatedField,omitempty"`
275 OptionalField *GoTestField `protobuf:"bytes,6,opt" json:"OptionalField,omitempty"`
276 F_BoolRequired *bool `protobuf:"varint,10,req,name=F_Bool_required" json:"F_Bool_required,omitempty"`
277 F_Int32Required *int32 `protobuf:"varint,11,req,name=F_Int32_required" json:"F_Int32_required,omitempty"`
278 F_Int64Required *int64 `protobuf:"varint,12,req,name=F_Int64_required" json:"F_Int64_required,omitempty"`
279 F_Fixed32Required *uint32 `protobuf:"fixed32,13,req,name=F_Fixed32_required" json:"F_Fixed32_required,omitempty"`
280 F_Fixed64Required *uint64 `protobuf:"fixed64,14,req,name=F_Fixed64_required" json:"F_Fixed64_required,omitempty"`
281 F_Uint32Required *uint32 `protobuf:"varint,15,req,name=F_Uint32_required" json:"F_Uint32_required,omitempty"`
282 F_Uint64Required *uint64 `protobuf:"varint,16,req,name=F_Uint64_required" json:"F_Uint64_required,omitempty"`
283 F_FloatRequired *float32 `protobuf:"fixed32,17,req,name=F_Float_required" json:"F_Float_required,omitempty"`
284 F_DoubleRequired *float64 `protobuf:"fixed64,18,req,name=F_Double_required" json:"F_Double_required,omitempty"`
285 F_StringRequired *string `protobuf:"bytes,19,req,name=F_String_required" json:"F_String_required,omitempty"`
286 F_BytesRequired []byte `protobuf:"bytes,101,req,name=F_Bytes_required" json:"F_Bytes_required,omitempty"`
287 F_Sint32Required *int32 `protobuf:"zigzag32,102,req,name=F_Sint32_required" json:"F_Sint32_required,omitempty"`
288 F_Sint64Required *int64 `protobuf:"zigzag64,103,req,name=F_Sint64_required" json:"F_Sint64_required,omitempty"`
289 F_BoolRepeated []bool `protobuf:"varint,20,rep,name=F_Bool_repeated" json:"F_Bool_repeated,omitempty"`
290 F_Int32Repeated []int32 `protobuf:"varint,21,rep,name=F_Int32_repeated" json:"F_Int32_repeated,omitempty"`
291 F_Int64Repeated []int64 `protobuf:"varint,22,rep,name=F_Int64_repeated" json:"F_Int64_repeated,omitempty"`
292 F_Fixed32Repeated []uint32 `protobuf:"fixed32,23,rep,name=F_Fixed32_repeated" json:"F_Fixed32_repeated,omitempty"`
293 F_Fixed64Repeated []uint64 `protobuf:"fixed64,24,rep,name=F_Fixed64_repeated" json:"F_Fixed64_repeated,omitempty"`
294 F_Uint32Repeated []uint32 `protobuf:"varint,25,rep,name=F_Uint32_repeated" json:"F_Uint32_repeated,omitempty"`
295 F_Uint64Repeated []uint64 `protobuf:"varint,26,rep,name=F_Uint64_repeated" json:"F_Uint64_repeated,omitempty"`
296 F_FloatRepeated []float32 `protobuf:"fixed32,27,rep,name=F_Float_repeated" json:"F_Float_repeated,omitempty"`
297 F_DoubleRepeated []float64 `protobuf:"fixed64,28,rep,name=F_Double_repeated" json:"F_Double_repeated,omitempty"`
298 F_StringRepeated []string `protobuf:"bytes,29,rep,name=F_String_repeated" json:"F_String_repeated,omitempty"`
299 F_BytesRepeated [][]byte `protobuf:"bytes,201,rep,name=F_Bytes_repeated" json:"F_Bytes_repeated,omitempty"`
300 F_Sint32Repeated []int32 `protobuf:"zigzag32,202,rep,name=F_Sint32_repeated" json:"F_Sint32_repeated,omitempty"`
301 F_Sint64Repeated []int64 `protobuf:"zigzag64,203,rep,name=F_Sint64_repeated" json:"F_Sint64_repeated,omitempty"`
302 F_BoolOptional *bool `protobuf:"varint,30,opt,name=F_Bool_optional" json:"F_Bool_optional,omitempty"`
303 F_Int32Optional *int32 `protobuf:"varint,31,opt,name=F_Int32_optional" json:"F_Int32_optional,omitempty"`
304 F_Int64Optional *int64 `protobuf:"varint,32,opt,name=F_Int64_optional" json:"F_Int64_optional,omitempty"`
305 F_Fixed32Optional *uint32 `protobuf:"fixed32,33,opt,name=F_Fixed32_optional" json:"F_Fixed32_optional,omitempty"`
306 F_Fixed64Optional *uint64 `protobuf:"fixed64,34,opt,name=F_Fixed64_optional" json:"F_Fixed64_optional,omitempty"`
307 F_Uint32Optional *uint32 `protobuf:"varint,35,opt,name=F_Uint32_optional" json:"F_Uint32_optional,omitempty"`
308 F_Uint64Optional *uint64 `protobuf:"varint,36,opt,name=F_Uint64_optional" json:"F_Uint64_optional,omitempty"`
309 F_FloatOptional *float32 `protobuf:"fixed32,37,opt,name=F_Float_optional" json:"F_Float_optional,omitempty"`
310 F_DoubleOptional *float64 `protobuf:"fixed64,38,opt,name=F_Double_optional" json:"F_Double_optional,omitempty"`
311 F_StringOptional *string `protobuf:"bytes,39,opt,name=F_String_optional" json:"F_String_optional,omitempty"`
312 F_BytesOptional []byte `protobuf:"bytes,301,opt,name=F_Bytes_optional" json:"F_Bytes_optional,omitempty"`
313 F_Sint32Optional *int32 `protobuf:"zigzag32,302,opt,name=F_Sint32_optional" json:"F_Sint32_optional,omitempty"`
314 F_Sint64Optional *int64 `protobuf:"zigzag64,303,opt,name=F_Sint64_optional" json:"F_Sint64_optional,omitempty"`
315 F_BoolDefaulted *bool `protobuf:"varint,40,opt,name=F_Bool_defaulted,def=1" json:"F_Bool_defaulted,omitempty"`
316 F_Int32Defaulted *int32 `protobuf:"varint,41,opt,name=F_Int32_defaulted,def=32" json:"F_Int32_defaulted,omitempty"`
317 F_Int64Defaulted *int64 `protobuf:"varint,42,opt,name=F_Int64_defaulted,def=64" json:"F_Int64_defaulted,omitempty"`
318 F_Fixed32Defaulted *uint32 `protobuf:"fixed32,43,opt,name=F_Fixed32_defaulted,def=320" json:"F_Fixed32_defaulted,omitempty"`
319 F_Fixed64Defaulted *uint64 `protobuf:"fixed64,44,opt,name=F_Fixed64_defaulted,def=640" json:"F_Fixed64_defaulted,omitempty"`
320 F_Uint32Defaulted *uint32 `protobuf:"varint,45,opt,name=F_Uint32_defaulted,def=3200" json:"F_Uint32_defaulted,omitempty"`
321 F_Uint64Defaulted *uint64 `protobuf:"varint,46,opt,name=F_Uint64_defaulted,def=6400" json:"F_Uint64_defaulted,omitempty"`
322 F_FloatDefaulted *float32 `protobuf:"fixed32,47,opt,name=F_Float_defaulted,def=314159" json:"F_Float_defaulted,omitempty"`
323 F_DoubleDefaulted *float64 `protobuf:"fixed64,48,opt,name=F_Double_defaulted,def=271828" json:"F_Double_defaulted,omitempty"`
324 F_StringDefaulted *string `protobuf:"bytes,49,opt,name=F_String_defaulted,def=hello, \"world!\"\n" json:"F_String_defaulted,omitempty"`
325 F_BytesDefaulted []byte `protobuf:"bytes,401,opt,name=F_Bytes_defaulted,def=Bignose" json:"F_Bytes_defaulted,omitempty"`
326 F_Sint32Defaulted *int32 `protobuf:"zigzag32,402,opt,name=F_Sint32_defaulted,def=-32" json:"F_Sint32_defaulted,omitempty"`
327 F_Sint64Defaulted *int64 `protobuf:"zigzag64,403,opt,name=F_Sint64_defaulted,def=-64" json:"F_Sint64_defaulted,omitempty"`
328 F_BoolRepeatedPacked []bool `protobuf:"varint,50,rep,packed,name=F_Bool_repeated_packed" json:"F_Bool_repeated_packed,omitempty"`
329 F_Int32RepeatedPacked []int32 `protobuf:"varint,51,rep,packed,name=F_Int32_repeated_packed" json:"F_Int32_repeated_packed,omitempty"`
330 F_Int64RepeatedPacked []int64 `protobuf:"varint,52,rep,packed,name=F_Int64_repeated_packed" json:"F_Int64_repeated_packed,omitempty"`
331 F_Fixed32RepeatedPacked []uint32 `protobuf:"fixed32,53,rep,packed,name=F_Fixed32_repeated_packed" json:"F_Fixed32_repeated_packed,omitempty"`
332 F_Fixed64RepeatedPacked []uint64 `protobuf:"fixed64,54,rep,packed,name=F_Fixed64_repeated_packed" json:"F_Fixed64_repeated_packed,omitempty"`
333 F_Uint32RepeatedPacked []uint32 `protobuf:"varint,55,rep,packed,name=F_Uint32_repeated_packed" json:"F_Uint32_repeated_packed,omitempty"`
334 F_Uint64RepeatedPacked []uint64 `protobuf:"varint,56,rep,packed,name=F_Uint64_repeated_packed" json:"F_Uint64_repeated_packed,omitempty"`
335 F_FloatRepeatedPacked []float32 `protobuf:"fixed32,57,rep,packed,name=F_Float_repeated_packed" json:"F_Float_repeated_packed,omitempty"`
336 F_DoubleRepeatedPacked []float64 `protobuf:"fixed64,58,rep,packed,name=F_Double_repeated_packed" json:"F_Double_repeated_packed,omitempty"`
337 F_Sint32RepeatedPacked []int32 `protobuf:"zigzag32,502,rep,packed,name=F_Sint32_repeated_packed" json:"F_Sint32_repeated_packed,omitempty"`
338 F_Sint64RepeatedPacked []int64 `protobuf:"zigzag64,503,rep,packed,name=F_Sint64_repeated_packed" json:"F_Sint64_repeated_packed,omitempty"`
339 Requiredgroup *GoTest_RequiredGroup `protobuf:"group,70,req,name=RequiredGroup" json:"requiredgroup,omitempty"`
340 Repeatedgroup []*GoTest_RepeatedGroup `protobuf:"group,80,rep,name=RepeatedGroup" json:"repeatedgroup,omitempty"`
341 Optionalgroup *GoTest_OptionalGroup `protobuf:"group,90,opt,name=OptionalGroup" json:"optionalgroup,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000342 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100343}
344
345func (this *GoTest) Reset() { *this = GoTest{} }
346func (this *GoTest) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000347func (*GoTest) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100348
349const Default_GoTest_F_BoolDefaulted bool = true
350const Default_GoTest_F_Int32Defaulted int32 = 32
351const Default_GoTest_F_Int64Defaulted int64 = 64
352const Default_GoTest_F_Fixed32Defaulted uint32 = 320
353const Default_GoTest_F_Fixed64Defaulted uint64 = 640
354const Default_GoTest_F_Uint32Defaulted uint32 = 3200
355const Default_GoTest_F_Uint64Defaulted uint64 = 6400
356const Default_GoTest_F_FloatDefaulted float32 = 314159
357const Default_GoTest_F_DoubleDefaulted float64 = 271828
358const Default_GoTest_F_StringDefaulted string = "hello, \"world!\"\n"
359
360var Default_GoTest_F_BytesDefaulted []byte = []byte("Bignose")
361
362const Default_GoTest_F_Sint32Defaulted int32 = -32
363const Default_GoTest_F_Sint64Defaulted int64 = -64
364
David Symonds0e084922012-07-02 16:04:40 -0700365func (this *GoTest) GetKind() GoTest_KIND {
366 if this != nil && this.Kind != nil {
367 return *this.Kind
368 }
369 return 0
370}
371
372func (this *GoTest) GetTable() string {
373 if this != nil && this.Table != nil {
374 return *this.Table
375 }
376 return ""
377}
378
379func (this *GoTest) GetParam() int32 {
380 if this != nil && this.Param != nil {
381 return *this.Param
382 }
383 return 0
384}
385
386func (this *GoTest) GetRequiredField() *GoTestField {
387 if this != nil {
388 return this.RequiredField
389 }
390 return nil
391}
392
393func (this *GoTest) GetOptionalField() *GoTestField {
394 if this != nil {
395 return this.OptionalField
396 }
397 return nil
398}
399
400func (this *GoTest) GetF_BoolRequired() bool {
401 if this != nil && this.F_BoolRequired != nil {
402 return *this.F_BoolRequired
403 }
404 return false
405}
406
407func (this *GoTest) GetF_Int32Required() int32 {
408 if this != nil && this.F_Int32Required != nil {
409 return *this.F_Int32Required
410 }
411 return 0
412}
413
414func (this *GoTest) GetF_Int64Required() int64 {
415 if this != nil && this.F_Int64Required != nil {
416 return *this.F_Int64Required
417 }
418 return 0
419}
420
421func (this *GoTest) GetF_Fixed32Required() uint32 {
422 if this != nil && this.F_Fixed32Required != nil {
423 return *this.F_Fixed32Required
424 }
425 return 0
426}
427
428func (this *GoTest) GetF_Fixed64Required() uint64 {
429 if this != nil && this.F_Fixed64Required != nil {
430 return *this.F_Fixed64Required
431 }
432 return 0
433}
434
435func (this *GoTest) GetF_Uint32Required() uint32 {
436 if this != nil && this.F_Uint32Required != nil {
437 return *this.F_Uint32Required
438 }
439 return 0
440}
441
442func (this *GoTest) GetF_Uint64Required() uint64 {
443 if this != nil && this.F_Uint64Required != nil {
444 return *this.F_Uint64Required
445 }
446 return 0
447}
448
449func (this *GoTest) GetF_FloatRequired() float32 {
450 if this != nil && this.F_FloatRequired != nil {
451 return *this.F_FloatRequired
452 }
453 return 0
454}
455
456func (this *GoTest) GetF_DoubleRequired() float64 {
457 if this != nil && this.F_DoubleRequired != nil {
458 return *this.F_DoubleRequired
459 }
460 return 0
461}
462
463func (this *GoTest) GetF_StringRequired() string {
464 if this != nil && this.F_StringRequired != nil {
465 return *this.F_StringRequired
466 }
467 return ""
468}
469
470func (this *GoTest) GetF_BytesRequired() []byte {
471 if this != nil {
472 return this.F_BytesRequired
473 }
474 return nil
475}
476
477func (this *GoTest) GetF_Sint32Required() int32 {
478 if this != nil && this.F_Sint32Required != nil {
479 return *this.F_Sint32Required
480 }
481 return 0
482}
483
484func (this *GoTest) GetF_Sint64Required() int64 {
485 if this != nil && this.F_Sint64Required != nil {
486 return *this.F_Sint64Required
487 }
488 return 0
489}
490
491func (this *GoTest) GetF_BoolOptional() bool {
492 if this != nil && this.F_BoolOptional != nil {
493 return *this.F_BoolOptional
494 }
495 return false
496}
497
498func (this *GoTest) GetF_Int32Optional() int32 {
499 if this != nil && this.F_Int32Optional != nil {
500 return *this.F_Int32Optional
501 }
502 return 0
503}
504
505func (this *GoTest) GetF_Int64Optional() int64 {
506 if this != nil && this.F_Int64Optional != nil {
507 return *this.F_Int64Optional
508 }
509 return 0
510}
511
512func (this *GoTest) GetF_Fixed32Optional() uint32 {
513 if this != nil && this.F_Fixed32Optional != nil {
514 return *this.F_Fixed32Optional
515 }
516 return 0
517}
518
519func (this *GoTest) GetF_Fixed64Optional() uint64 {
520 if this != nil && this.F_Fixed64Optional != nil {
521 return *this.F_Fixed64Optional
522 }
523 return 0
524}
525
526func (this *GoTest) GetF_Uint32Optional() uint32 {
527 if this != nil && this.F_Uint32Optional != nil {
528 return *this.F_Uint32Optional
529 }
530 return 0
531}
532
533func (this *GoTest) GetF_Uint64Optional() uint64 {
534 if this != nil && this.F_Uint64Optional != nil {
535 return *this.F_Uint64Optional
536 }
537 return 0
538}
539
540func (this *GoTest) GetF_FloatOptional() float32 {
541 if this != nil && this.F_FloatOptional != nil {
542 return *this.F_FloatOptional
543 }
544 return 0
545}
546
547func (this *GoTest) GetF_DoubleOptional() float64 {
548 if this != nil && this.F_DoubleOptional != nil {
549 return *this.F_DoubleOptional
550 }
551 return 0
552}
553
554func (this *GoTest) GetF_StringOptional() string {
555 if this != nil && this.F_StringOptional != nil {
556 return *this.F_StringOptional
557 }
558 return ""
559}
560
561func (this *GoTest) GetF_BytesOptional() []byte {
562 if this != nil {
563 return this.F_BytesOptional
564 }
565 return nil
566}
567
568func (this *GoTest) GetF_Sint32Optional() int32 {
569 if this != nil && this.F_Sint32Optional != nil {
570 return *this.F_Sint32Optional
571 }
572 return 0
573}
574
575func (this *GoTest) GetF_Sint64Optional() int64 {
576 if this != nil && this.F_Sint64Optional != nil {
577 return *this.F_Sint64Optional
578 }
579 return 0
580}
581
582func (this *GoTest) GetF_BoolDefaulted() bool {
583 if this != nil && this.F_BoolDefaulted != nil {
584 return *this.F_BoolDefaulted
585 }
586 return Default_GoTest_F_BoolDefaulted
587}
588
589func (this *GoTest) GetF_Int32Defaulted() int32 {
590 if this != nil && this.F_Int32Defaulted != nil {
591 return *this.F_Int32Defaulted
592 }
593 return Default_GoTest_F_Int32Defaulted
594}
595
596func (this *GoTest) GetF_Int64Defaulted() int64 {
597 if this != nil && this.F_Int64Defaulted != nil {
598 return *this.F_Int64Defaulted
599 }
600 return Default_GoTest_F_Int64Defaulted
601}
602
603func (this *GoTest) GetF_Fixed32Defaulted() uint32 {
604 if this != nil && this.F_Fixed32Defaulted != nil {
605 return *this.F_Fixed32Defaulted
606 }
607 return Default_GoTest_F_Fixed32Defaulted
608}
609
610func (this *GoTest) GetF_Fixed64Defaulted() uint64 {
611 if this != nil && this.F_Fixed64Defaulted != nil {
612 return *this.F_Fixed64Defaulted
613 }
614 return Default_GoTest_F_Fixed64Defaulted
615}
616
617func (this *GoTest) GetF_Uint32Defaulted() uint32 {
618 if this != nil && this.F_Uint32Defaulted != nil {
619 return *this.F_Uint32Defaulted
620 }
621 return Default_GoTest_F_Uint32Defaulted
622}
623
624func (this *GoTest) GetF_Uint64Defaulted() uint64 {
625 if this != nil && this.F_Uint64Defaulted != nil {
626 return *this.F_Uint64Defaulted
627 }
628 return Default_GoTest_F_Uint64Defaulted
629}
630
631func (this *GoTest) GetF_FloatDefaulted() float32 {
632 if this != nil && this.F_FloatDefaulted != nil {
633 return *this.F_FloatDefaulted
634 }
635 return Default_GoTest_F_FloatDefaulted
636}
637
638func (this *GoTest) GetF_DoubleDefaulted() float64 {
639 if this != nil && this.F_DoubleDefaulted != nil {
640 return *this.F_DoubleDefaulted
641 }
642 return Default_GoTest_F_DoubleDefaulted
643}
644
645func (this *GoTest) GetF_StringDefaulted() string {
646 if this != nil && this.F_StringDefaulted != nil {
647 return *this.F_StringDefaulted
648 }
649 return Default_GoTest_F_StringDefaulted
650}
651
652func (this *GoTest) GetF_BytesDefaulted() []byte {
653 if this != nil && this.F_BytesDefaulted != nil {
654 return this.F_BytesDefaulted
655 }
656 return append([]byte(nil), Default_GoTest_F_BytesDefaulted...)
657}
658
659func (this *GoTest) GetF_Sint32Defaulted() int32 {
660 if this != nil && this.F_Sint32Defaulted != nil {
661 return *this.F_Sint32Defaulted
662 }
663 return Default_GoTest_F_Sint32Defaulted
664}
665
666func (this *GoTest) GetF_Sint64Defaulted() int64 {
667 if this != nil && this.F_Sint64Defaulted != nil {
668 return *this.F_Sint64Defaulted
669 }
670 return Default_GoTest_F_Sint64Defaulted
671}
672
673func (this *GoTest) GetRequiredgroup() *GoTest_RequiredGroup {
674 if this != nil {
675 return this.Requiredgroup
676 }
677 return nil
678}
679
680func (this *GoTest) GetOptionalgroup() *GoTest_OptionalGroup {
681 if this != nil {
682 return this.Optionalgroup
683 }
684 return nil
685}
686
Rob Pikeb7907bf2012-02-13 14:25:20 +1100687type GoTest_RequiredGroup struct {
David Symondsfc16c2c2012-11-07 23:41:17 +1100688 RequiredField *string `protobuf:"bytes,71,req" json:"RequiredField,omitempty"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100689}
690
David Symondsfc16c2c2012-11-07 23:41:17 +1100691func (this *GoTest_RequiredGroup) Reset() { *this = GoTest_RequiredGroup{} }
Rob Pikeb7907bf2012-02-13 14:25:20 +1100692
David Symonds0e084922012-07-02 16:04:40 -0700693func (this *GoTest_RequiredGroup) GetRequiredField() string {
694 if this != nil && this.RequiredField != nil {
695 return *this.RequiredField
696 }
697 return ""
698}
699
Rob Pikeb7907bf2012-02-13 14:25:20 +1100700type GoTest_RepeatedGroup struct {
David Symondsfc16c2c2012-11-07 23:41:17 +1100701 RequiredField *string `protobuf:"bytes,81,req" json:"RequiredField,omitempty"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100702}
703
David Symondsfc16c2c2012-11-07 23:41:17 +1100704func (this *GoTest_RepeatedGroup) Reset() { *this = GoTest_RepeatedGroup{} }
Rob Pikeb7907bf2012-02-13 14:25:20 +1100705
David Symonds0e084922012-07-02 16:04:40 -0700706func (this *GoTest_RepeatedGroup) GetRequiredField() string {
707 if this != nil && this.RequiredField != nil {
708 return *this.RequiredField
709 }
710 return ""
711}
712
Rob Pikeb7907bf2012-02-13 14:25:20 +1100713type GoTest_OptionalGroup struct {
David Symondsfc16c2c2012-11-07 23:41:17 +1100714 RequiredField *string `protobuf:"bytes,91,req" json:"RequiredField,omitempty"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100715}
716
David Symondsfc16c2c2012-11-07 23:41:17 +1100717func (this *GoTest_OptionalGroup) Reset() { *this = GoTest_OptionalGroup{} }
Rob Pikeb7907bf2012-02-13 14:25:20 +1100718
David Symonds0e084922012-07-02 16:04:40 -0700719func (this *GoTest_OptionalGroup) GetRequiredField() string {
720 if this != nil && this.RequiredField != nil {
721 return *this.RequiredField
722 }
723 return ""
724}
725
Rob Pikeb7907bf2012-02-13 14:25:20 +1100726type GoSkipTest struct {
727 SkipInt32 *int32 `protobuf:"varint,11,req,name=skip_int32" json:"skip_int32,omitempty"`
728 SkipFixed32 *uint32 `protobuf:"fixed32,12,req,name=skip_fixed32" json:"skip_fixed32,omitempty"`
729 SkipFixed64 *uint64 `protobuf:"fixed64,13,req,name=skip_fixed64" json:"skip_fixed64,omitempty"`
730 SkipString *string `protobuf:"bytes,14,req,name=skip_string" json:"skip_string,omitempty"`
731 Skipgroup *GoSkipTest_SkipGroup `protobuf:"group,15,req,name=SkipGroup" json:"skipgroup,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000732 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100733}
734
735func (this *GoSkipTest) Reset() { *this = GoSkipTest{} }
736func (this *GoSkipTest) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000737func (*GoSkipTest) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100738
David Symonds0e084922012-07-02 16:04:40 -0700739func (this *GoSkipTest) GetSkipInt32() int32 {
740 if this != nil && this.SkipInt32 != nil {
741 return *this.SkipInt32
742 }
743 return 0
744}
745
746func (this *GoSkipTest) GetSkipFixed32() uint32 {
747 if this != nil && this.SkipFixed32 != nil {
748 return *this.SkipFixed32
749 }
750 return 0
751}
752
753func (this *GoSkipTest) GetSkipFixed64() uint64 {
754 if this != nil && this.SkipFixed64 != nil {
755 return *this.SkipFixed64
756 }
757 return 0
758}
759
760func (this *GoSkipTest) GetSkipString() string {
761 if this != nil && this.SkipString != nil {
762 return *this.SkipString
763 }
764 return ""
765}
766
767func (this *GoSkipTest) GetSkipgroup() *GoSkipTest_SkipGroup {
768 if this != nil {
769 return this.Skipgroup
770 }
771 return nil
772}
773
Rob Pikeb7907bf2012-02-13 14:25:20 +1100774type GoSkipTest_SkipGroup struct {
David Symondsfc16c2c2012-11-07 23:41:17 +1100775 GroupInt32 *int32 `protobuf:"varint,16,req,name=group_int32" json:"group_int32,omitempty"`
776 GroupString *string `protobuf:"bytes,17,req,name=group_string" json:"group_string,omitempty"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100777}
778
David Symondsfc16c2c2012-11-07 23:41:17 +1100779func (this *GoSkipTest_SkipGroup) Reset() { *this = GoSkipTest_SkipGroup{} }
Rob Pikeb7907bf2012-02-13 14:25:20 +1100780
David Symonds0e084922012-07-02 16:04:40 -0700781func (this *GoSkipTest_SkipGroup) GetGroupInt32() int32 {
782 if this != nil && this.GroupInt32 != nil {
783 return *this.GroupInt32
784 }
785 return 0
786}
787
788func (this *GoSkipTest_SkipGroup) GetGroupString() string {
789 if this != nil && this.GroupString != nil {
790 return *this.GroupString
791 }
792 return ""
793}
794
Rob Pikeb7907bf2012-02-13 14:25:20 +1100795type NonPackedTest struct {
796 A []int32 `protobuf:"varint,1,rep,name=a" json:"a,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000797 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100798}
799
800func (this *NonPackedTest) Reset() { *this = NonPackedTest{} }
801func (this *NonPackedTest) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000802func (*NonPackedTest) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100803
804type PackedTest struct {
805 B []int32 `protobuf:"varint,1,rep,packed,name=b" json:"b,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000806 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100807}
808
809func (this *PackedTest) Reset() { *this = PackedTest{} }
810func (this *PackedTest) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000811func (*PackedTest) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100812
813type MaxTag struct {
814 LastField *string `protobuf:"bytes,536870911,opt,name=last_field" json:"last_field,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000815 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100816}
817
818func (this *MaxTag) Reset() { *this = MaxTag{} }
819func (this *MaxTag) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000820func (*MaxTag) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100821
David Symonds0e084922012-07-02 16:04:40 -0700822func (this *MaxTag) GetLastField() string {
823 if this != nil && this.LastField != nil {
824 return *this.LastField
825 }
826 return ""
827}
828
David Symonds10c93ba2012-08-04 16:38:08 +1000829type OldMessage struct {
830 Nested *OldMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"`
831 XXX_unrecognized []byte `json:"-"`
832}
833
834func (this *OldMessage) Reset() { *this = OldMessage{} }
835func (this *OldMessage) String() string { return proto.CompactTextString(this) }
836func (*OldMessage) ProtoMessage() {}
837
838func (this *OldMessage) GetNested() *OldMessage_Nested {
839 if this != nil {
840 return this.Nested
841 }
842 return nil
843}
844
845type OldMessage_Nested struct {
846 Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
847 XXX_unrecognized []byte `json:"-"`
848}
849
850func (this *OldMessage_Nested) Reset() { *this = OldMessage_Nested{} }
851func (this *OldMessage_Nested) String() string { return proto.CompactTextString(this) }
852func (*OldMessage_Nested) ProtoMessage() {}
853
854func (this *OldMessage_Nested) GetName() string {
855 if this != nil && this.Name != nil {
856 return *this.Name
857 }
858 return ""
859}
860
861type NewMessage struct {
862 Nested *NewMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"`
863 XXX_unrecognized []byte `json:"-"`
864}
865
866func (this *NewMessage) Reset() { *this = NewMessage{} }
867func (this *NewMessage) String() string { return proto.CompactTextString(this) }
868func (*NewMessage) ProtoMessage() {}
869
870func (this *NewMessage) GetNested() *NewMessage_Nested {
871 if this != nil {
872 return this.Nested
873 }
874 return nil
875}
876
877type NewMessage_Nested struct {
878 Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
879 FoodGroup *string `protobuf:"bytes,2,opt,name=food_group" json:"food_group,omitempty"`
880 XXX_unrecognized []byte `json:"-"`
881}
882
883func (this *NewMessage_Nested) Reset() { *this = NewMessage_Nested{} }
884func (this *NewMessage_Nested) String() string { return proto.CompactTextString(this) }
885func (*NewMessage_Nested) ProtoMessage() {}
886
887func (this *NewMessage_Nested) GetName() string {
888 if this != nil && this.Name != nil {
889 return *this.Name
890 }
891 return ""
892}
893
894func (this *NewMessage_Nested) GetFoodGroup() string {
895 if this != nil && this.FoodGroup != nil {
896 return *this.FoodGroup
897 }
898 return ""
899}
900
Rob Pikeb7907bf2012-02-13 14:25:20 +1100901type InnerMessage struct {
902 Host *string `protobuf:"bytes,1,req,name=host" json:"host,omitempty"`
903 Port *int32 `protobuf:"varint,2,opt,name=port,def=4000" json:"port,omitempty"`
904 Connected *bool `protobuf:"varint,3,opt,name=connected" json:"connected,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000905 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100906}
907
908func (this *InnerMessage) Reset() { *this = InnerMessage{} }
909func (this *InnerMessage) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000910func (*InnerMessage) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100911
912const Default_InnerMessage_Port int32 = 4000
913
David Symonds0e084922012-07-02 16:04:40 -0700914func (this *InnerMessage) GetHost() string {
915 if this != nil && this.Host != nil {
916 return *this.Host
917 }
918 return ""
919}
920
921func (this *InnerMessage) GetPort() int32 {
922 if this != nil && this.Port != nil {
923 return *this.Port
924 }
925 return Default_InnerMessage_Port
926}
927
928func (this *InnerMessage) GetConnected() bool {
929 if this != nil && this.Connected != nil {
930 return *this.Connected
931 }
932 return false
933}
934
Rob Pikeb7907bf2012-02-13 14:25:20 +1100935type OtherMessage struct {
936 Key *int64 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"`
937 Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
938 Weight *float32 `protobuf:"fixed32,3,opt,name=weight" json:"weight,omitempty"`
939 Inner *InnerMessage `protobuf:"bytes,4,opt,name=inner" json:"inner,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000940 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100941}
942
943func (this *OtherMessage) Reset() { *this = OtherMessage{} }
944func (this *OtherMessage) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000945func (*OtherMessage) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100946
David Symonds0e084922012-07-02 16:04:40 -0700947func (this *OtherMessage) GetKey() int64 {
948 if this != nil && this.Key != nil {
949 return *this.Key
950 }
951 return 0
952}
953
954func (this *OtherMessage) GetValue() []byte {
955 if this != nil {
956 return this.Value
957 }
958 return nil
959}
960
961func (this *OtherMessage) GetWeight() float32 {
962 if this != nil && this.Weight != nil {
963 return *this.Weight
964 }
965 return 0
966}
967
968func (this *OtherMessage) GetInner() *InnerMessage {
969 if this != nil {
970 return this.Inner
971 }
972 return nil
973}
974
Rob Pikeb7907bf2012-02-13 14:25:20 +1100975type MyMessage struct {
976 Count *int32 `protobuf:"varint,1,req,name=count" json:"count,omitempty"`
977 Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
978 Quote *string `protobuf:"bytes,3,opt,name=quote" json:"quote,omitempty"`
979 Pet []string `protobuf:"bytes,4,rep,name=pet" json:"pet,omitempty"`
980 Inner *InnerMessage `protobuf:"bytes,5,opt,name=inner" json:"inner,omitempty"`
981 Others []*OtherMessage `protobuf:"bytes,6,rep,name=others" json:"others,omitempty"`
982 Bikeshed *MyMessage_Color `protobuf:"varint,7,opt,name=bikeshed,enum=testdata.MyMessage_Color" json:"bikeshed,omitempty"`
983 Somegroup *MyMessage_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"`
984 RepBytes [][]byte `protobuf:"bytes,10,rep,name=rep_bytes" json:"rep_bytes,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +1000985 XXX_extensions map[int32]proto.Extension `json:"-"`
986 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +1100987}
988
989func (this *MyMessage) Reset() { *this = MyMessage{} }
990func (this *MyMessage) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +1000991func (*MyMessage) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +1100992
993var extRange_MyMessage = []proto.ExtensionRange{
994 {100, 536870911},
995}
996
997func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange {
998 return extRange_MyMessage
999}
1000func (this *MyMessage) ExtensionMap() map[int32]proto.Extension {
1001 if this.XXX_extensions == nil {
1002 this.XXX_extensions = make(map[int32]proto.Extension)
1003 }
1004 return this.XXX_extensions
1005}
1006
David Symonds0e084922012-07-02 16:04:40 -07001007func (this *MyMessage) GetCount() int32 {
1008 if this != nil && this.Count != nil {
1009 return *this.Count
1010 }
1011 return 0
1012}
1013
1014func (this *MyMessage) GetName() string {
1015 if this != nil && this.Name != nil {
1016 return *this.Name
1017 }
1018 return ""
1019}
1020
1021func (this *MyMessage) GetQuote() string {
1022 if this != nil && this.Quote != nil {
1023 return *this.Quote
1024 }
1025 return ""
1026}
1027
1028func (this *MyMessage) GetInner() *InnerMessage {
1029 if this != nil {
1030 return this.Inner
1031 }
1032 return nil
1033}
1034
1035func (this *MyMessage) GetBikeshed() MyMessage_Color {
1036 if this != nil && this.Bikeshed != nil {
1037 return *this.Bikeshed
1038 }
1039 return 0
1040}
1041
1042func (this *MyMessage) GetSomegroup() *MyMessage_SomeGroup {
1043 if this != nil {
1044 return this.Somegroup
1045 }
1046 return nil
1047}
1048
Rob Pikeb7907bf2012-02-13 14:25:20 +11001049type MyMessage_SomeGroup struct {
David Symondsfc16c2c2012-11-07 23:41:17 +11001050 GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001051}
1052
David Symondsfc16c2c2012-11-07 23:41:17 +11001053func (this *MyMessage_SomeGroup) Reset() { *this = MyMessage_SomeGroup{} }
Rob Pikeb7907bf2012-02-13 14:25:20 +11001054
David Symonds0e084922012-07-02 16:04:40 -07001055func (this *MyMessage_SomeGroup) GetGroupField() int32 {
1056 if this != nil && this.GroupField != nil {
1057 return *this.GroupField
1058 }
1059 return 0
1060}
1061
Rob Pikeb7907bf2012-02-13 14:25:20 +11001062type Ext struct {
1063 Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001064 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001065}
1066
1067func (this *Ext) Reset() { *this = Ext{} }
1068func (this *Ext) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001069func (*Ext) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001070
David Symonds0e084922012-07-02 16:04:40 -07001071func (this *Ext) GetData() string {
1072 if this != nil && this.Data != nil {
1073 return *this.Data
1074 }
1075 return ""
1076}
1077
Rob Pikeb7907bf2012-02-13 14:25:20 +11001078var E_Ext_More = &proto.ExtensionDesc{
1079 ExtendedType: (*MyMessage)(nil),
1080 ExtensionType: (*Ext)(nil),
1081 Field: 103,
1082 Name: "testdata.Ext.more",
1083 Tag: "bytes,103,opt,name=more",
1084}
1085
1086var E_Ext_Text = &proto.ExtensionDesc{
1087 ExtendedType: (*MyMessage)(nil),
1088 ExtensionType: (*string)(nil),
1089 Field: 104,
1090 Name: "testdata.Ext.text",
1091 Tag: "bytes,104,opt,name=text",
1092}
1093
1094var E_Ext_Number = &proto.ExtensionDesc{
1095 ExtendedType: (*MyMessage)(nil),
1096 ExtensionType: (*int32)(nil),
1097 Field: 105,
1098 Name: "testdata.Ext.number",
1099 Tag: "varint,105,opt,name=number",
1100}
1101
1102type MessageList struct {
1103 Message []*MessageList_Message `protobuf:"group,1,rep" json:"message,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001104 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001105}
1106
1107func (this *MessageList) Reset() { *this = MessageList{} }
1108func (this *MessageList) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001109func (*MessageList) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001110
1111type MessageList_Message struct {
David Symondsfc16c2c2012-11-07 23:41:17 +11001112 Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"`
1113 Count *int32 `protobuf:"varint,3,req,name=count" json:"count,omitempty"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001114}
1115
David Symondsfc16c2c2012-11-07 23:41:17 +11001116func (this *MessageList_Message) Reset() { *this = MessageList_Message{} }
Rob Pikeb7907bf2012-02-13 14:25:20 +11001117
David Symonds0e084922012-07-02 16:04:40 -07001118func (this *MessageList_Message) GetName() string {
1119 if this != nil && this.Name != nil {
1120 return *this.Name
1121 }
1122 return ""
1123}
1124
1125func (this *MessageList_Message) GetCount() int32 {
1126 if this != nil && this.Count != nil {
1127 return *this.Count
1128 }
1129 return 0
1130}
1131
Rob Pikeb7907bf2012-02-13 14:25:20 +11001132type Strings struct {
1133 StringField *string `protobuf:"bytes,1,opt,name=string_field" json:"string_field,omitempty"`
1134 BytesField []byte `protobuf:"bytes,2,opt,name=bytes_field" json:"bytes_field,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001135 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001136}
1137
1138func (this *Strings) Reset() { *this = Strings{} }
1139func (this *Strings) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001140func (*Strings) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001141
David Symonds0e084922012-07-02 16:04:40 -07001142func (this *Strings) GetStringField() string {
1143 if this != nil && this.StringField != nil {
1144 return *this.StringField
1145 }
1146 return ""
1147}
1148
1149func (this *Strings) GetBytesField() []byte {
1150 if this != nil {
1151 return this.BytesField
1152 }
1153 return nil
1154}
1155
Rob Pikeb7907bf2012-02-13 14:25:20 +11001156type Defaults struct {
1157 F_Bool *bool `protobuf:"varint,1,opt,def=1" json:"F_Bool,omitempty"`
1158 F_Int32 *int32 `protobuf:"varint,2,opt,def=32" json:"F_Int32,omitempty"`
1159 F_Int64 *int64 `protobuf:"varint,3,opt,def=64" json:"F_Int64,omitempty"`
1160 F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,def=320" json:"F_Fixed32,omitempty"`
1161 F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,def=640" json:"F_Fixed64,omitempty"`
1162 F_Uint32 *uint32 `protobuf:"varint,6,opt,def=3200" json:"F_Uint32,omitempty"`
1163 F_Uint64 *uint64 `protobuf:"varint,7,opt,def=6400" json:"F_Uint64,omitempty"`
1164 F_Float *float32 `protobuf:"fixed32,8,opt,def=314159" json:"F_Float,omitempty"`
1165 F_Double *float64 `protobuf:"fixed64,9,opt,def=271828" json:"F_Double,omitempty"`
1166 F_String *string `protobuf:"bytes,10,opt,def=hello, \"world!\"\n" json:"F_String,omitempty"`
1167 F_Bytes []byte `protobuf:"bytes,11,opt,def=Bignose" json:"F_Bytes,omitempty"`
1168 F_Sint32 *int32 `protobuf:"zigzag32,12,opt,def=-32" json:"F_Sint32,omitempty"`
1169 F_Sint64 *int64 `protobuf:"zigzag64,13,opt,def=-64" json:"F_Sint64,omitempty"`
1170 F_Enum *Defaults_Color `protobuf:"varint,14,opt,enum=testdata.Defaults_Color,def=1" json:"F_Enum,omitempty"`
1171 F_Pinf *float32 `protobuf:"fixed32,15,opt,def=inf" json:"F_Pinf,omitempty"`
1172 F_Ninf *float32 `protobuf:"fixed32,16,opt,def=-inf" json:"F_Ninf,omitempty"`
1173 F_Nan *float32 `protobuf:"fixed32,17,opt,def=nan" json:"F_Nan,omitempty"`
1174 Sub *SubDefaults `protobuf:"bytes,18,opt,name=sub" json:"sub,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001175 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001176}
1177
1178func (this *Defaults) Reset() { *this = Defaults{} }
1179func (this *Defaults) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001180func (*Defaults) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001181
1182const Default_Defaults_F_Bool bool = true
1183const Default_Defaults_F_Int32 int32 = 32
1184const Default_Defaults_F_Int64 int64 = 64
1185const Default_Defaults_F_Fixed32 uint32 = 320
1186const Default_Defaults_F_Fixed64 uint64 = 640
1187const Default_Defaults_F_Uint32 uint32 = 3200
1188const Default_Defaults_F_Uint64 uint64 = 6400
1189const Default_Defaults_F_Float float32 = 314159
1190const Default_Defaults_F_Double float64 = 271828
1191const Default_Defaults_F_String string = "hello, \"world!\"\n"
1192
1193var Default_Defaults_F_Bytes []byte = []byte("Bignose")
1194
1195const Default_Defaults_F_Sint32 int32 = -32
1196const Default_Defaults_F_Sint64 int64 = -64
1197const Default_Defaults_F_Enum Defaults_Color = Defaults_GREEN
1198
1199var Default_Defaults_F_Pinf float32 = float32(math.Inf(1))
1200var Default_Defaults_F_Ninf float32 = float32(math.Inf(-1))
1201var Default_Defaults_F_Nan float32 = float32(math.NaN())
1202
David Symonds0e084922012-07-02 16:04:40 -07001203func (this *Defaults) GetF_Bool() bool {
1204 if this != nil && this.F_Bool != nil {
1205 return *this.F_Bool
1206 }
1207 return Default_Defaults_F_Bool
1208}
1209
1210func (this *Defaults) GetF_Int32() int32 {
1211 if this != nil && this.F_Int32 != nil {
1212 return *this.F_Int32
1213 }
1214 return Default_Defaults_F_Int32
1215}
1216
1217func (this *Defaults) GetF_Int64() int64 {
1218 if this != nil && this.F_Int64 != nil {
1219 return *this.F_Int64
1220 }
1221 return Default_Defaults_F_Int64
1222}
1223
1224func (this *Defaults) GetF_Fixed32() uint32 {
1225 if this != nil && this.F_Fixed32 != nil {
1226 return *this.F_Fixed32
1227 }
1228 return Default_Defaults_F_Fixed32
1229}
1230
1231func (this *Defaults) GetF_Fixed64() uint64 {
1232 if this != nil && this.F_Fixed64 != nil {
1233 return *this.F_Fixed64
1234 }
1235 return Default_Defaults_F_Fixed64
1236}
1237
1238func (this *Defaults) GetF_Uint32() uint32 {
1239 if this != nil && this.F_Uint32 != nil {
1240 return *this.F_Uint32
1241 }
1242 return Default_Defaults_F_Uint32
1243}
1244
1245func (this *Defaults) GetF_Uint64() uint64 {
1246 if this != nil && this.F_Uint64 != nil {
1247 return *this.F_Uint64
1248 }
1249 return Default_Defaults_F_Uint64
1250}
1251
1252func (this *Defaults) GetF_Float() float32 {
1253 if this != nil && this.F_Float != nil {
1254 return *this.F_Float
1255 }
1256 return Default_Defaults_F_Float
1257}
1258
1259func (this *Defaults) GetF_Double() float64 {
1260 if this != nil && this.F_Double != nil {
1261 return *this.F_Double
1262 }
1263 return Default_Defaults_F_Double
1264}
1265
1266func (this *Defaults) GetF_String() string {
1267 if this != nil && this.F_String != nil {
1268 return *this.F_String
1269 }
1270 return Default_Defaults_F_String
1271}
1272
1273func (this *Defaults) GetF_Bytes() []byte {
1274 if this != nil && this.F_Bytes != nil {
1275 return this.F_Bytes
1276 }
1277 return append([]byte(nil), Default_Defaults_F_Bytes...)
1278}
1279
1280func (this *Defaults) GetF_Sint32() int32 {
1281 if this != nil && this.F_Sint32 != nil {
1282 return *this.F_Sint32
1283 }
1284 return Default_Defaults_F_Sint32
1285}
1286
1287func (this *Defaults) GetF_Sint64() int64 {
1288 if this != nil && this.F_Sint64 != nil {
1289 return *this.F_Sint64
1290 }
1291 return Default_Defaults_F_Sint64
1292}
1293
1294func (this *Defaults) GetF_Enum() Defaults_Color {
1295 if this != nil && this.F_Enum != nil {
1296 return *this.F_Enum
1297 }
1298 return Default_Defaults_F_Enum
1299}
1300
1301func (this *Defaults) GetF_Pinf() float32 {
1302 if this != nil && this.F_Pinf != nil {
1303 return *this.F_Pinf
1304 }
1305 return Default_Defaults_F_Pinf
1306}
1307
1308func (this *Defaults) GetF_Ninf() float32 {
1309 if this != nil && this.F_Ninf != nil {
1310 return *this.F_Ninf
1311 }
1312 return Default_Defaults_F_Ninf
1313}
1314
1315func (this *Defaults) GetF_Nan() float32 {
1316 if this != nil && this.F_Nan != nil {
1317 return *this.F_Nan
1318 }
1319 return Default_Defaults_F_Nan
1320}
1321
1322func (this *Defaults) GetSub() *SubDefaults {
1323 if this != nil {
1324 return this.Sub
1325 }
1326 return nil
1327}
1328
Rob Pikeb7907bf2012-02-13 14:25:20 +11001329type SubDefaults struct {
1330 N *int64 `protobuf:"varint,1,opt,name=n,def=7" json:"n,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001331 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001332}
1333
1334func (this *SubDefaults) Reset() { *this = SubDefaults{} }
1335func (this *SubDefaults) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001336func (*SubDefaults) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001337
1338const Default_SubDefaults_N int64 = 7
1339
David Symonds0e084922012-07-02 16:04:40 -07001340func (this *SubDefaults) GetN() int64 {
1341 if this != nil && this.N != nil {
1342 return *this.N
1343 }
1344 return Default_SubDefaults_N
1345}
1346
Rob Pikeb7907bf2012-02-13 14:25:20 +11001347type RepeatedEnum struct {
1348 Color []RepeatedEnum_Color `protobuf:"varint,1,rep,name=color,enum=testdata.RepeatedEnum_Color" json:"color,omitempty"`
David Symonds61826da2012-05-05 09:31:28 +10001349 XXX_unrecognized []byte `json:"-"`
Rob Pikeb7907bf2012-02-13 14:25:20 +11001350}
1351
1352func (this *RepeatedEnum) Reset() { *this = RepeatedEnum{} }
1353func (this *RepeatedEnum) String() string { return proto.CompactTextString(this) }
David Symonds9f60f432012-06-14 09:45:25 +10001354func (*RepeatedEnum) ProtoMessage() {}
Rob Pikeb7907bf2012-02-13 14:25:20 +11001355
David Symondsfc16c2c2012-11-07 23:41:17 +11001356type MoreRepeated struct {
1357 Bools []bool `protobuf:"varint,1,rep,name=bools" json:"bools,omitempty"`
1358 BoolsPacked []bool `protobuf:"varint,2,rep,packed,name=bools_packed" json:"bools_packed,omitempty"`
1359 Ints []int32 `protobuf:"varint,3,rep,name=ints" json:"ints,omitempty"`
1360 IntsPacked []int32 `protobuf:"varint,4,rep,packed,name=ints_packed" json:"ints_packed,omitempty"`
1361 Strings []string `protobuf:"bytes,5,rep,name=strings" json:"strings,omitempty"`
1362 XXX_unrecognized []byte `json:"-"`
1363}
1364
1365func (this *MoreRepeated) Reset() { *this = MoreRepeated{} }
1366func (this *MoreRepeated) String() string { return proto.CompactTextString(this) }
1367func (*MoreRepeated) ProtoMessage() {}
1368
David Symonds61826da2012-05-05 09:31:28 +10001369var E_Greeting = &proto.ExtensionDesc{
1370 ExtendedType: (*MyMessage)(nil),
1371 ExtensionType: ([]string)(nil),
1372 Field: 106,
1373 Name: "testdata.greeting",
1374 Tag: "bytes,106,rep,name=greeting",
1375}
1376
Rob Pikeb7907bf2012-02-13 14:25:20 +11001377func init() {
1378 proto.RegisterEnum("testdata.FOO", FOO_name, FOO_value)
1379 proto.RegisterEnum("testdata.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value)
1380 proto.RegisterEnum("testdata.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value)
1381 proto.RegisterEnum("testdata.Defaults_Color", Defaults_Color_name, Defaults_Color_value)
1382 proto.RegisterEnum("testdata.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value)
1383 proto.RegisterExtension(E_Ext_More)
1384 proto.RegisterExtension(E_Ext_Text)
1385 proto.RegisterExtension(E_Ext_Number)
David Symonds61826da2012-05-05 09:31:28 +10001386 proto.RegisterExtension(E_Greeting)
Rob Pikeb7907bf2012-02-13 14:25:20 +11001387}