| David Symonds | afbae88 | 2012-09-24 13:21:21 +1000 | [diff] [blame] | 1 | // Code generated by protoc-gen-go. |
| 2 | // source: test.proto |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 3 | // DO NOT EDIT! |
| 4 | |
| 5 | package testdata |
| 6 | |
| 7 | import proto "code.google.com/p/goprotobuf/proto" |
| David Symonds | afbae88 | 2012-09-24 13:21:21 +1000 | [diff] [blame] | 8 | import json "encoding/json" |
| 9 | import math "math" |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 10 | |
| David Symonds | 6253986 | 2012-08-04 10:06:55 +1000 | [diff] [blame] | 11 | // Reference proto, json, and math imports to suppress error if they are not otherwise used. |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 12 | var _ = proto.Marshal |
| David Symonds | 6253986 | 2012-08-04 10:06:55 +1000 | [diff] [blame] | 13 | var _ = &json.SyntaxError{} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 14 | var _ = math.Inf |
| 15 | |
| 16 | type FOO int32 |
| 17 | |
| 18 | const ( |
| 19 | FOO_FOO1 FOO = 1 |
| 20 | ) |
| 21 | |
| 22 | var FOO_name = map[int32]string{ |
| 23 | 1: "FOO1", |
| 24 | } |
| 25 | var FOO_value = map[string]int32{ |
| 26 | "FOO1": 1, |
| 27 | } |
| 28 | |
| David Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 29 | func (x FOO) Enum() *FOO { |
| 30 | p := new(FOO) |
| 31 | *p = x |
| 32 | return p |
| 33 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 34 | func (x FOO) String() string { |
| 35 | return proto.EnumName(FOO_name, int32(x)) |
| 36 | } |
| David Symonds | 6253986 | 2012-08-04 10:06:55 +1000 | [diff] [blame] | 37 | func (x FOO) MarshalJSON() ([]byte, error) { |
| 38 | return json.Marshal(x.String()) |
| 39 | } |
| 40 | func (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 Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 48 | |
| 49 | type GoTest_KIND int32 |
| 50 | |
| 51 | const ( |
| 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 | |
| 67 | var 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 | } |
| 82 | var 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 Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 98 | func (x GoTest_KIND) Enum() *GoTest_KIND { |
| 99 | p := new(GoTest_KIND) |
| 100 | *p = x |
| 101 | return p |
| 102 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 103 | func (x GoTest_KIND) String() string { |
| 104 | return proto.EnumName(GoTest_KIND_name, int32(x)) |
| 105 | } |
| David Symonds | 6253986 | 2012-08-04 10:06:55 +1000 | [diff] [blame] | 106 | func (x GoTest_KIND) MarshalJSON() ([]byte, error) { |
| 107 | return json.Marshal(x.String()) |
| 108 | } |
| 109 | func (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 Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 117 | |
| 118 | type MyMessage_Color int32 |
| 119 | |
| 120 | const ( |
| 121 | MyMessage_RED MyMessage_Color = 0 |
| 122 | MyMessage_GREEN MyMessage_Color = 1 |
| 123 | MyMessage_BLUE MyMessage_Color = 2 |
| 124 | ) |
| 125 | |
| 126 | var MyMessage_Color_name = map[int32]string{ |
| 127 | 0: "RED", |
| 128 | 1: "GREEN", |
| 129 | 2: "BLUE", |
| 130 | } |
| 131 | var MyMessage_Color_value = map[string]int32{ |
| 132 | "RED": 0, |
| 133 | "GREEN": 1, |
| 134 | "BLUE": 2, |
| 135 | } |
| 136 | |
| David Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 137 | func (x MyMessage_Color) Enum() *MyMessage_Color { |
| 138 | p := new(MyMessage_Color) |
| 139 | *p = x |
| 140 | return p |
| 141 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 142 | func (x MyMessage_Color) String() string { |
| 143 | return proto.EnumName(MyMessage_Color_name, int32(x)) |
| 144 | } |
| David Symonds | 6253986 | 2012-08-04 10:06:55 +1000 | [diff] [blame] | 145 | func (x MyMessage_Color) MarshalJSON() ([]byte, error) { |
| 146 | return json.Marshal(x.String()) |
| 147 | } |
| 148 | func (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 Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 156 | |
| 157 | type Defaults_Color int32 |
| 158 | |
| 159 | const ( |
| 160 | Defaults_RED Defaults_Color = 0 |
| 161 | Defaults_GREEN Defaults_Color = 1 |
| 162 | Defaults_BLUE Defaults_Color = 2 |
| 163 | ) |
| 164 | |
| 165 | var Defaults_Color_name = map[int32]string{ |
| 166 | 0: "RED", |
| 167 | 1: "GREEN", |
| 168 | 2: "BLUE", |
| 169 | } |
| 170 | var Defaults_Color_value = map[string]int32{ |
| 171 | "RED": 0, |
| 172 | "GREEN": 1, |
| 173 | "BLUE": 2, |
| 174 | } |
| 175 | |
| David Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 176 | func (x Defaults_Color) Enum() *Defaults_Color { |
| 177 | p := new(Defaults_Color) |
| 178 | *p = x |
| 179 | return p |
| 180 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 181 | func (x Defaults_Color) String() string { |
| 182 | return proto.EnumName(Defaults_Color_name, int32(x)) |
| 183 | } |
| David Symonds | 6253986 | 2012-08-04 10:06:55 +1000 | [diff] [blame] | 184 | func (x Defaults_Color) MarshalJSON() ([]byte, error) { |
| 185 | return json.Marshal(x.String()) |
| 186 | } |
| 187 | func (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 Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 195 | |
| 196 | type RepeatedEnum_Color int32 |
| 197 | |
| 198 | const ( |
| 199 | RepeatedEnum_RED RepeatedEnum_Color = 1 |
| 200 | ) |
| 201 | |
| 202 | var RepeatedEnum_Color_name = map[int32]string{ |
| 203 | 1: "RED", |
| 204 | } |
| 205 | var RepeatedEnum_Color_value = map[string]int32{ |
| 206 | "RED": 1, |
| 207 | } |
| 208 | |
| David Symonds | efeca9a | 2012-05-08 10:36:04 +1000 | [diff] [blame] | 209 | func (x RepeatedEnum_Color) Enum() *RepeatedEnum_Color { |
| 210 | p := new(RepeatedEnum_Color) |
| 211 | *p = x |
| 212 | return p |
| 213 | } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 214 | func (x RepeatedEnum_Color) String() string { |
| 215 | return proto.EnumName(RepeatedEnum_Color_name, int32(x)) |
| 216 | } |
| David Symonds | 6253986 | 2012-08-04 10:06:55 +1000 | [diff] [blame] | 217 | func (x RepeatedEnum_Color) MarshalJSON() ([]byte, error) { |
| 218 | return json.Marshal(x.String()) |
| 219 | } |
| 220 | func (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 Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 228 | |
| 229 | type GoEnum struct { |
| 230 | Foo *FOO `protobuf:"varint,1,req,name=foo,enum=testdata.FOO" json:"foo,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 231 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | func (this *GoEnum) Reset() { *this = GoEnum{} } |
| 235 | func (this *GoEnum) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 236 | func (*GoEnum) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 237 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 238 | func (this *GoEnum) GetFoo() FOO { |
| 239 | if this != nil && this.Foo != nil { |
| 240 | return *this.Foo |
| 241 | } |
| 242 | return 0 |
| 243 | } |
| 244 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 245 | type GoTestField struct { |
| 246 | Label *string `protobuf:"bytes,1,req" json:"Label,omitempty"` |
| 247 | Type *string `protobuf:"bytes,2,req" json:"Type,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 248 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 249 | } |
| 250 | |
| 251 | func (this *GoTestField) Reset() { *this = GoTestField{} } |
| 252 | func (this *GoTestField) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 253 | func (*GoTestField) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 254 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 255 | func (this *GoTestField) GetLabel() string { |
| 256 | if this != nil && this.Label != nil { |
| 257 | return *this.Label |
| 258 | } |
| 259 | return "" |
| 260 | } |
| 261 | |
| 262 | func (this *GoTestField) GetType() string { |
| 263 | if this != nil && this.Type != nil { |
| 264 | return *this.Type |
| 265 | } |
| 266 | return "" |
| 267 | } |
| 268 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 269 | type 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 Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 342 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 343 | } |
| 344 | |
| 345 | func (this *GoTest) Reset() { *this = GoTest{} } |
| 346 | func (this *GoTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 347 | func (*GoTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 348 | |
| 349 | const Default_GoTest_F_BoolDefaulted bool = true |
| 350 | const Default_GoTest_F_Int32Defaulted int32 = 32 |
| 351 | const Default_GoTest_F_Int64Defaulted int64 = 64 |
| 352 | const Default_GoTest_F_Fixed32Defaulted uint32 = 320 |
| 353 | const Default_GoTest_F_Fixed64Defaulted uint64 = 640 |
| 354 | const Default_GoTest_F_Uint32Defaulted uint32 = 3200 |
| 355 | const Default_GoTest_F_Uint64Defaulted uint64 = 6400 |
| 356 | const Default_GoTest_F_FloatDefaulted float32 = 314159 |
| 357 | const Default_GoTest_F_DoubleDefaulted float64 = 271828 |
| 358 | const Default_GoTest_F_StringDefaulted string = "hello, \"world!\"\n" |
| 359 | |
| 360 | var Default_GoTest_F_BytesDefaulted []byte = []byte("Bignose") |
| 361 | |
| 362 | const Default_GoTest_F_Sint32Defaulted int32 = -32 |
| 363 | const Default_GoTest_F_Sint64Defaulted int64 = -64 |
| 364 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 365 | func (this *GoTest) GetKind() GoTest_KIND { |
| 366 | if this != nil && this.Kind != nil { |
| 367 | return *this.Kind |
| 368 | } |
| 369 | return 0 |
| 370 | } |
| 371 | |
| 372 | func (this *GoTest) GetTable() string { |
| 373 | if this != nil && this.Table != nil { |
| 374 | return *this.Table |
| 375 | } |
| 376 | return "" |
| 377 | } |
| 378 | |
| 379 | func (this *GoTest) GetParam() int32 { |
| 380 | if this != nil && this.Param != nil { |
| 381 | return *this.Param |
| 382 | } |
| 383 | return 0 |
| 384 | } |
| 385 | |
| 386 | func (this *GoTest) GetRequiredField() *GoTestField { |
| 387 | if this != nil { |
| 388 | return this.RequiredField |
| 389 | } |
| 390 | return nil |
| 391 | } |
| 392 | |
| 393 | func (this *GoTest) GetOptionalField() *GoTestField { |
| 394 | if this != nil { |
| 395 | return this.OptionalField |
| 396 | } |
| 397 | return nil |
| 398 | } |
| 399 | |
| 400 | func (this *GoTest) GetF_BoolRequired() bool { |
| 401 | if this != nil && this.F_BoolRequired != nil { |
| 402 | return *this.F_BoolRequired |
| 403 | } |
| 404 | return false |
| 405 | } |
| 406 | |
| 407 | func (this *GoTest) GetF_Int32Required() int32 { |
| 408 | if this != nil && this.F_Int32Required != nil { |
| 409 | return *this.F_Int32Required |
| 410 | } |
| 411 | return 0 |
| 412 | } |
| 413 | |
| 414 | func (this *GoTest) GetF_Int64Required() int64 { |
| 415 | if this != nil && this.F_Int64Required != nil { |
| 416 | return *this.F_Int64Required |
| 417 | } |
| 418 | return 0 |
| 419 | } |
| 420 | |
| 421 | func (this *GoTest) GetF_Fixed32Required() uint32 { |
| 422 | if this != nil && this.F_Fixed32Required != nil { |
| 423 | return *this.F_Fixed32Required |
| 424 | } |
| 425 | return 0 |
| 426 | } |
| 427 | |
| 428 | func (this *GoTest) GetF_Fixed64Required() uint64 { |
| 429 | if this != nil && this.F_Fixed64Required != nil { |
| 430 | return *this.F_Fixed64Required |
| 431 | } |
| 432 | return 0 |
| 433 | } |
| 434 | |
| 435 | func (this *GoTest) GetF_Uint32Required() uint32 { |
| 436 | if this != nil && this.F_Uint32Required != nil { |
| 437 | return *this.F_Uint32Required |
| 438 | } |
| 439 | return 0 |
| 440 | } |
| 441 | |
| 442 | func (this *GoTest) GetF_Uint64Required() uint64 { |
| 443 | if this != nil && this.F_Uint64Required != nil { |
| 444 | return *this.F_Uint64Required |
| 445 | } |
| 446 | return 0 |
| 447 | } |
| 448 | |
| 449 | func (this *GoTest) GetF_FloatRequired() float32 { |
| 450 | if this != nil && this.F_FloatRequired != nil { |
| 451 | return *this.F_FloatRequired |
| 452 | } |
| 453 | return 0 |
| 454 | } |
| 455 | |
| 456 | func (this *GoTest) GetF_DoubleRequired() float64 { |
| 457 | if this != nil && this.F_DoubleRequired != nil { |
| 458 | return *this.F_DoubleRequired |
| 459 | } |
| 460 | return 0 |
| 461 | } |
| 462 | |
| 463 | func (this *GoTest) GetF_StringRequired() string { |
| 464 | if this != nil && this.F_StringRequired != nil { |
| 465 | return *this.F_StringRequired |
| 466 | } |
| 467 | return "" |
| 468 | } |
| 469 | |
| 470 | func (this *GoTest) GetF_BytesRequired() []byte { |
| 471 | if this != nil { |
| 472 | return this.F_BytesRequired |
| 473 | } |
| 474 | return nil |
| 475 | } |
| 476 | |
| 477 | func (this *GoTest) GetF_Sint32Required() int32 { |
| 478 | if this != nil && this.F_Sint32Required != nil { |
| 479 | return *this.F_Sint32Required |
| 480 | } |
| 481 | return 0 |
| 482 | } |
| 483 | |
| 484 | func (this *GoTest) GetF_Sint64Required() int64 { |
| 485 | if this != nil && this.F_Sint64Required != nil { |
| 486 | return *this.F_Sint64Required |
| 487 | } |
| 488 | return 0 |
| 489 | } |
| 490 | |
| 491 | func (this *GoTest) GetF_BoolOptional() bool { |
| 492 | if this != nil && this.F_BoolOptional != nil { |
| 493 | return *this.F_BoolOptional |
| 494 | } |
| 495 | return false |
| 496 | } |
| 497 | |
| 498 | func (this *GoTest) GetF_Int32Optional() int32 { |
| 499 | if this != nil && this.F_Int32Optional != nil { |
| 500 | return *this.F_Int32Optional |
| 501 | } |
| 502 | return 0 |
| 503 | } |
| 504 | |
| 505 | func (this *GoTest) GetF_Int64Optional() int64 { |
| 506 | if this != nil && this.F_Int64Optional != nil { |
| 507 | return *this.F_Int64Optional |
| 508 | } |
| 509 | return 0 |
| 510 | } |
| 511 | |
| 512 | func (this *GoTest) GetF_Fixed32Optional() uint32 { |
| 513 | if this != nil && this.F_Fixed32Optional != nil { |
| 514 | return *this.F_Fixed32Optional |
| 515 | } |
| 516 | return 0 |
| 517 | } |
| 518 | |
| 519 | func (this *GoTest) GetF_Fixed64Optional() uint64 { |
| 520 | if this != nil && this.F_Fixed64Optional != nil { |
| 521 | return *this.F_Fixed64Optional |
| 522 | } |
| 523 | return 0 |
| 524 | } |
| 525 | |
| 526 | func (this *GoTest) GetF_Uint32Optional() uint32 { |
| 527 | if this != nil && this.F_Uint32Optional != nil { |
| 528 | return *this.F_Uint32Optional |
| 529 | } |
| 530 | return 0 |
| 531 | } |
| 532 | |
| 533 | func (this *GoTest) GetF_Uint64Optional() uint64 { |
| 534 | if this != nil && this.F_Uint64Optional != nil { |
| 535 | return *this.F_Uint64Optional |
| 536 | } |
| 537 | return 0 |
| 538 | } |
| 539 | |
| 540 | func (this *GoTest) GetF_FloatOptional() float32 { |
| 541 | if this != nil && this.F_FloatOptional != nil { |
| 542 | return *this.F_FloatOptional |
| 543 | } |
| 544 | return 0 |
| 545 | } |
| 546 | |
| 547 | func (this *GoTest) GetF_DoubleOptional() float64 { |
| 548 | if this != nil && this.F_DoubleOptional != nil { |
| 549 | return *this.F_DoubleOptional |
| 550 | } |
| 551 | return 0 |
| 552 | } |
| 553 | |
| 554 | func (this *GoTest) GetF_StringOptional() string { |
| 555 | if this != nil && this.F_StringOptional != nil { |
| 556 | return *this.F_StringOptional |
| 557 | } |
| 558 | return "" |
| 559 | } |
| 560 | |
| 561 | func (this *GoTest) GetF_BytesOptional() []byte { |
| 562 | if this != nil { |
| 563 | return this.F_BytesOptional |
| 564 | } |
| 565 | return nil |
| 566 | } |
| 567 | |
| 568 | func (this *GoTest) GetF_Sint32Optional() int32 { |
| 569 | if this != nil && this.F_Sint32Optional != nil { |
| 570 | return *this.F_Sint32Optional |
| 571 | } |
| 572 | return 0 |
| 573 | } |
| 574 | |
| 575 | func (this *GoTest) GetF_Sint64Optional() int64 { |
| 576 | if this != nil && this.F_Sint64Optional != nil { |
| 577 | return *this.F_Sint64Optional |
| 578 | } |
| 579 | return 0 |
| 580 | } |
| 581 | |
| 582 | func (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 | |
| 589 | func (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 | |
| 596 | func (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 | |
| 603 | func (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 | |
| 610 | func (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 | |
| 617 | func (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 | |
| 624 | func (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 | |
| 631 | func (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 | |
| 638 | func (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 | |
| 645 | func (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 | |
| 652 | func (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 | |
| 659 | func (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 | |
| 666 | func (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 | |
| 673 | func (this *GoTest) GetRequiredgroup() *GoTest_RequiredGroup { |
| 674 | if this != nil { |
| 675 | return this.Requiredgroup |
| 676 | } |
| 677 | return nil |
| 678 | } |
| 679 | |
| 680 | func (this *GoTest) GetOptionalgroup() *GoTest_OptionalGroup { |
| 681 | if this != nil { |
| 682 | return this.Optionalgroup |
| 683 | } |
| 684 | return nil |
| 685 | } |
| 686 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 687 | type GoTest_RequiredGroup struct { |
| 688 | RequiredField *string `protobuf:"bytes,71,req" json:"RequiredField,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 689 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 690 | } |
| 691 | |
| 692 | func (this *GoTest_RequiredGroup) Reset() { *this = GoTest_RequiredGroup{} } |
| 693 | func (this *GoTest_RequiredGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 694 | func (*GoTest_RequiredGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 695 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 696 | func (this *GoTest_RequiredGroup) GetRequiredField() string { |
| 697 | if this != nil && this.RequiredField != nil { |
| 698 | return *this.RequiredField |
| 699 | } |
| 700 | return "" |
| 701 | } |
| 702 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 703 | type GoTest_RepeatedGroup struct { |
| 704 | RequiredField *string `protobuf:"bytes,81,req" json:"RequiredField,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 705 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 706 | } |
| 707 | |
| 708 | func (this *GoTest_RepeatedGroup) Reset() { *this = GoTest_RepeatedGroup{} } |
| 709 | func (this *GoTest_RepeatedGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 710 | func (*GoTest_RepeatedGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 711 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 712 | func (this *GoTest_RepeatedGroup) GetRequiredField() string { |
| 713 | if this != nil && this.RequiredField != nil { |
| 714 | return *this.RequiredField |
| 715 | } |
| 716 | return "" |
| 717 | } |
| 718 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 719 | type GoTest_OptionalGroup struct { |
| 720 | RequiredField *string `protobuf:"bytes,91,req" json:"RequiredField,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 721 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 722 | } |
| 723 | |
| 724 | func (this *GoTest_OptionalGroup) Reset() { *this = GoTest_OptionalGroup{} } |
| 725 | func (this *GoTest_OptionalGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 726 | func (*GoTest_OptionalGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 727 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 728 | func (this *GoTest_OptionalGroup) GetRequiredField() string { |
| 729 | if this != nil && this.RequiredField != nil { |
| 730 | return *this.RequiredField |
| 731 | } |
| 732 | return "" |
| 733 | } |
| 734 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 735 | type GoSkipTest struct { |
| 736 | SkipInt32 *int32 `protobuf:"varint,11,req,name=skip_int32" json:"skip_int32,omitempty"` |
| 737 | SkipFixed32 *uint32 `protobuf:"fixed32,12,req,name=skip_fixed32" json:"skip_fixed32,omitempty"` |
| 738 | SkipFixed64 *uint64 `protobuf:"fixed64,13,req,name=skip_fixed64" json:"skip_fixed64,omitempty"` |
| 739 | SkipString *string `protobuf:"bytes,14,req,name=skip_string" json:"skip_string,omitempty"` |
| 740 | Skipgroup *GoSkipTest_SkipGroup `protobuf:"group,15,req,name=SkipGroup" json:"skipgroup,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 741 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 742 | } |
| 743 | |
| 744 | func (this *GoSkipTest) Reset() { *this = GoSkipTest{} } |
| 745 | func (this *GoSkipTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 746 | func (*GoSkipTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 747 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 748 | func (this *GoSkipTest) GetSkipInt32() int32 { |
| 749 | if this != nil && this.SkipInt32 != nil { |
| 750 | return *this.SkipInt32 |
| 751 | } |
| 752 | return 0 |
| 753 | } |
| 754 | |
| 755 | func (this *GoSkipTest) GetSkipFixed32() uint32 { |
| 756 | if this != nil && this.SkipFixed32 != nil { |
| 757 | return *this.SkipFixed32 |
| 758 | } |
| 759 | return 0 |
| 760 | } |
| 761 | |
| 762 | func (this *GoSkipTest) GetSkipFixed64() uint64 { |
| 763 | if this != nil && this.SkipFixed64 != nil { |
| 764 | return *this.SkipFixed64 |
| 765 | } |
| 766 | return 0 |
| 767 | } |
| 768 | |
| 769 | func (this *GoSkipTest) GetSkipString() string { |
| 770 | if this != nil && this.SkipString != nil { |
| 771 | return *this.SkipString |
| 772 | } |
| 773 | return "" |
| 774 | } |
| 775 | |
| 776 | func (this *GoSkipTest) GetSkipgroup() *GoSkipTest_SkipGroup { |
| 777 | if this != nil { |
| 778 | return this.Skipgroup |
| 779 | } |
| 780 | return nil |
| 781 | } |
| 782 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 783 | type GoSkipTest_SkipGroup struct { |
| 784 | GroupInt32 *int32 `protobuf:"varint,16,req,name=group_int32" json:"group_int32,omitempty"` |
| 785 | GroupString *string `protobuf:"bytes,17,req,name=group_string" json:"group_string,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 786 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 787 | } |
| 788 | |
| 789 | func (this *GoSkipTest_SkipGroup) Reset() { *this = GoSkipTest_SkipGroup{} } |
| 790 | func (this *GoSkipTest_SkipGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 791 | func (*GoSkipTest_SkipGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 792 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 793 | func (this *GoSkipTest_SkipGroup) GetGroupInt32() int32 { |
| 794 | if this != nil && this.GroupInt32 != nil { |
| 795 | return *this.GroupInt32 |
| 796 | } |
| 797 | return 0 |
| 798 | } |
| 799 | |
| 800 | func (this *GoSkipTest_SkipGroup) GetGroupString() string { |
| 801 | if this != nil && this.GroupString != nil { |
| 802 | return *this.GroupString |
| 803 | } |
| 804 | return "" |
| 805 | } |
| 806 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 807 | type NonPackedTest struct { |
| 808 | A []int32 `protobuf:"varint,1,rep,name=a" json:"a,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 809 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 810 | } |
| 811 | |
| 812 | func (this *NonPackedTest) Reset() { *this = NonPackedTest{} } |
| 813 | func (this *NonPackedTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 814 | func (*NonPackedTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 815 | |
| 816 | type PackedTest struct { |
| 817 | B []int32 `protobuf:"varint,1,rep,packed,name=b" json:"b,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 818 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 819 | } |
| 820 | |
| 821 | func (this *PackedTest) Reset() { *this = PackedTest{} } |
| 822 | func (this *PackedTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 823 | func (*PackedTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 824 | |
| 825 | type MaxTag struct { |
| 826 | LastField *string `protobuf:"bytes,536870911,opt,name=last_field" json:"last_field,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 827 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 828 | } |
| 829 | |
| 830 | func (this *MaxTag) Reset() { *this = MaxTag{} } |
| 831 | func (this *MaxTag) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 832 | func (*MaxTag) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 833 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 834 | func (this *MaxTag) GetLastField() string { |
| 835 | if this != nil && this.LastField != nil { |
| 836 | return *this.LastField |
| 837 | } |
| 838 | return "" |
| 839 | } |
| 840 | |
| David Symonds | 10c93ba | 2012-08-04 16:38:08 +1000 | [diff] [blame] | 841 | type OldMessage struct { |
| 842 | Nested *OldMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` |
| 843 | XXX_unrecognized []byte `json:"-"` |
| 844 | } |
| 845 | |
| 846 | func (this *OldMessage) Reset() { *this = OldMessage{} } |
| 847 | func (this *OldMessage) String() string { return proto.CompactTextString(this) } |
| 848 | func (*OldMessage) ProtoMessage() {} |
| 849 | |
| 850 | func (this *OldMessage) GetNested() *OldMessage_Nested { |
| 851 | if this != nil { |
| 852 | return this.Nested |
| 853 | } |
| 854 | return nil |
| 855 | } |
| 856 | |
| 857 | type OldMessage_Nested struct { |
| 858 | Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` |
| 859 | XXX_unrecognized []byte `json:"-"` |
| 860 | } |
| 861 | |
| 862 | func (this *OldMessage_Nested) Reset() { *this = OldMessage_Nested{} } |
| 863 | func (this *OldMessage_Nested) String() string { return proto.CompactTextString(this) } |
| 864 | func (*OldMessage_Nested) ProtoMessage() {} |
| 865 | |
| 866 | func (this *OldMessage_Nested) GetName() string { |
| 867 | if this != nil && this.Name != nil { |
| 868 | return *this.Name |
| 869 | } |
| 870 | return "" |
| 871 | } |
| 872 | |
| 873 | type NewMessage struct { |
| 874 | Nested *NewMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` |
| 875 | XXX_unrecognized []byte `json:"-"` |
| 876 | } |
| 877 | |
| 878 | func (this *NewMessage) Reset() { *this = NewMessage{} } |
| 879 | func (this *NewMessage) String() string { return proto.CompactTextString(this) } |
| 880 | func (*NewMessage) ProtoMessage() {} |
| 881 | |
| 882 | func (this *NewMessage) GetNested() *NewMessage_Nested { |
| 883 | if this != nil { |
| 884 | return this.Nested |
| 885 | } |
| 886 | return nil |
| 887 | } |
| 888 | |
| 889 | type NewMessage_Nested struct { |
| 890 | Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` |
| 891 | FoodGroup *string `protobuf:"bytes,2,opt,name=food_group" json:"food_group,omitempty"` |
| 892 | XXX_unrecognized []byte `json:"-"` |
| 893 | } |
| 894 | |
| 895 | func (this *NewMessage_Nested) Reset() { *this = NewMessage_Nested{} } |
| 896 | func (this *NewMessage_Nested) String() string { return proto.CompactTextString(this) } |
| 897 | func (*NewMessage_Nested) ProtoMessage() {} |
| 898 | |
| 899 | func (this *NewMessage_Nested) GetName() string { |
| 900 | if this != nil && this.Name != nil { |
| 901 | return *this.Name |
| 902 | } |
| 903 | return "" |
| 904 | } |
| 905 | |
| 906 | func (this *NewMessage_Nested) GetFoodGroup() string { |
| 907 | if this != nil && this.FoodGroup != nil { |
| 908 | return *this.FoodGroup |
| 909 | } |
| 910 | return "" |
| 911 | } |
| 912 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 913 | type InnerMessage struct { |
| 914 | Host *string `protobuf:"bytes,1,req,name=host" json:"host,omitempty"` |
| 915 | Port *int32 `protobuf:"varint,2,opt,name=port,def=4000" json:"port,omitempty"` |
| 916 | Connected *bool `protobuf:"varint,3,opt,name=connected" json:"connected,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 917 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 918 | } |
| 919 | |
| 920 | func (this *InnerMessage) Reset() { *this = InnerMessage{} } |
| 921 | func (this *InnerMessage) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 922 | func (*InnerMessage) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 923 | |
| 924 | const Default_InnerMessage_Port int32 = 4000 |
| 925 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 926 | func (this *InnerMessage) GetHost() string { |
| 927 | if this != nil && this.Host != nil { |
| 928 | return *this.Host |
| 929 | } |
| 930 | return "" |
| 931 | } |
| 932 | |
| 933 | func (this *InnerMessage) GetPort() int32 { |
| 934 | if this != nil && this.Port != nil { |
| 935 | return *this.Port |
| 936 | } |
| 937 | return Default_InnerMessage_Port |
| 938 | } |
| 939 | |
| 940 | func (this *InnerMessage) GetConnected() bool { |
| 941 | if this != nil && this.Connected != nil { |
| 942 | return *this.Connected |
| 943 | } |
| 944 | return false |
| 945 | } |
| 946 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 947 | type OtherMessage struct { |
| 948 | Key *int64 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"` |
| 949 | Value []byte `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` |
| 950 | Weight *float32 `protobuf:"fixed32,3,opt,name=weight" json:"weight,omitempty"` |
| 951 | Inner *InnerMessage `protobuf:"bytes,4,opt,name=inner" json:"inner,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 952 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 953 | } |
| 954 | |
| 955 | func (this *OtherMessage) Reset() { *this = OtherMessage{} } |
| 956 | func (this *OtherMessage) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 957 | func (*OtherMessage) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 958 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 959 | func (this *OtherMessage) GetKey() int64 { |
| 960 | if this != nil && this.Key != nil { |
| 961 | return *this.Key |
| 962 | } |
| 963 | return 0 |
| 964 | } |
| 965 | |
| 966 | func (this *OtherMessage) GetValue() []byte { |
| 967 | if this != nil { |
| 968 | return this.Value |
| 969 | } |
| 970 | return nil |
| 971 | } |
| 972 | |
| 973 | func (this *OtherMessage) GetWeight() float32 { |
| 974 | if this != nil && this.Weight != nil { |
| 975 | return *this.Weight |
| 976 | } |
| 977 | return 0 |
| 978 | } |
| 979 | |
| 980 | func (this *OtherMessage) GetInner() *InnerMessage { |
| 981 | if this != nil { |
| 982 | return this.Inner |
| 983 | } |
| 984 | return nil |
| 985 | } |
| 986 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 987 | type MyMessage struct { |
| 988 | Count *int32 `protobuf:"varint,1,req,name=count" json:"count,omitempty"` |
| 989 | Name *string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` |
| 990 | Quote *string `protobuf:"bytes,3,opt,name=quote" json:"quote,omitempty"` |
| 991 | Pet []string `protobuf:"bytes,4,rep,name=pet" json:"pet,omitempty"` |
| 992 | Inner *InnerMessage `protobuf:"bytes,5,opt,name=inner" json:"inner,omitempty"` |
| 993 | Others []*OtherMessage `protobuf:"bytes,6,rep,name=others" json:"others,omitempty"` |
| 994 | Bikeshed *MyMessage_Color `protobuf:"varint,7,opt,name=bikeshed,enum=testdata.MyMessage_Color" json:"bikeshed,omitempty"` |
| 995 | Somegroup *MyMessage_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"` |
| 996 | RepBytes [][]byte `protobuf:"bytes,10,rep,name=rep_bytes" json:"rep_bytes,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 997 | XXX_extensions map[int32]proto.Extension `json:"-"` |
| 998 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 999 | } |
| 1000 | |
| 1001 | func (this *MyMessage) Reset() { *this = MyMessage{} } |
| 1002 | func (this *MyMessage) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1003 | func (*MyMessage) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1004 | |
| 1005 | var extRange_MyMessage = []proto.ExtensionRange{ |
| 1006 | {100, 536870911}, |
| 1007 | } |
| 1008 | |
| 1009 | func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange { |
| 1010 | return extRange_MyMessage |
| 1011 | } |
| 1012 | func (this *MyMessage) ExtensionMap() map[int32]proto.Extension { |
| 1013 | if this.XXX_extensions == nil { |
| 1014 | this.XXX_extensions = make(map[int32]proto.Extension) |
| 1015 | } |
| 1016 | return this.XXX_extensions |
| 1017 | } |
| 1018 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1019 | func (this *MyMessage) GetCount() int32 { |
| 1020 | if this != nil && this.Count != nil { |
| 1021 | return *this.Count |
| 1022 | } |
| 1023 | return 0 |
| 1024 | } |
| 1025 | |
| 1026 | func (this *MyMessage) GetName() string { |
| 1027 | if this != nil && this.Name != nil { |
| 1028 | return *this.Name |
| 1029 | } |
| 1030 | return "" |
| 1031 | } |
| 1032 | |
| 1033 | func (this *MyMessage) GetQuote() string { |
| 1034 | if this != nil && this.Quote != nil { |
| 1035 | return *this.Quote |
| 1036 | } |
| 1037 | return "" |
| 1038 | } |
| 1039 | |
| 1040 | func (this *MyMessage) GetInner() *InnerMessage { |
| 1041 | if this != nil { |
| 1042 | return this.Inner |
| 1043 | } |
| 1044 | return nil |
| 1045 | } |
| 1046 | |
| 1047 | func (this *MyMessage) GetBikeshed() MyMessage_Color { |
| 1048 | if this != nil && this.Bikeshed != nil { |
| 1049 | return *this.Bikeshed |
| 1050 | } |
| 1051 | return 0 |
| 1052 | } |
| 1053 | |
| 1054 | func (this *MyMessage) GetSomegroup() *MyMessage_SomeGroup { |
| 1055 | if this != nil { |
| 1056 | return this.Somegroup |
| 1057 | } |
| 1058 | return nil |
| 1059 | } |
| 1060 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1061 | type MyMessage_SomeGroup struct { |
| 1062 | GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1063 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1064 | } |
| 1065 | |
| 1066 | func (this *MyMessage_SomeGroup) Reset() { *this = MyMessage_SomeGroup{} } |
| 1067 | func (this *MyMessage_SomeGroup) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1068 | func (*MyMessage_SomeGroup) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1069 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1070 | func (this *MyMessage_SomeGroup) GetGroupField() int32 { |
| 1071 | if this != nil && this.GroupField != nil { |
| 1072 | return *this.GroupField |
| 1073 | } |
| 1074 | return 0 |
| 1075 | } |
| 1076 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1077 | type Ext struct { |
| 1078 | Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1079 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1080 | } |
| 1081 | |
| 1082 | func (this *Ext) Reset() { *this = Ext{} } |
| 1083 | func (this *Ext) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1084 | func (*Ext) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1085 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1086 | func (this *Ext) GetData() string { |
| 1087 | if this != nil && this.Data != nil { |
| 1088 | return *this.Data |
| 1089 | } |
| 1090 | return "" |
| 1091 | } |
| 1092 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1093 | var E_Ext_More = &proto.ExtensionDesc{ |
| 1094 | ExtendedType: (*MyMessage)(nil), |
| 1095 | ExtensionType: (*Ext)(nil), |
| 1096 | Field: 103, |
| 1097 | Name: "testdata.Ext.more", |
| 1098 | Tag: "bytes,103,opt,name=more", |
| 1099 | } |
| 1100 | |
| 1101 | var E_Ext_Text = &proto.ExtensionDesc{ |
| 1102 | ExtendedType: (*MyMessage)(nil), |
| 1103 | ExtensionType: (*string)(nil), |
| 1104 | Field: 104, |
| 1105 | Name: "testdata.Ext.text", |
| 1106 | Tag: "bytes,104,opt,name=text", |
| 1107 | } |
| 1108 | |
| 1109 | var E_Ext_Number = &proto.ExtensionDesc{ |
| 1110 | ExtendedType: (*MyMessage)(nil), |
| 1111 | ExtensionType: (*int32)(nil), |
| 1112 | Field: 105, |
| 1113 | Name: "testdata.Ext.number", |
| 1114 | Tag: "varint,105,opt,name=number", |
| 1115 | } |
| 1116 | |
| 1117 | type MessageList struct { |
| 1118 | Message []*MessageList_Message `protobuf:"group,1,rep" json:"message,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1119 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1120 | } |
| 1121 | |
| 1122 | func (this *MessageList) Reset() { *this = MessageList{} } |
| 1123 | func (this *MessageList) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1124 | func (*MessageList) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1125 | |
| 1126 | type MessageList_Message struct { |
| 1127 | Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` |
| 1128 | Count *int32 `protobuf:"varint,3,req,name=count" json:"count,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1129 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1130 | } |
| 1131 | |
| 1132 | func (this *MessageList_Message) Reset() { *this = MessageList_Message{} } |
| 1133 | func (this *MessageList_Message) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1134 | func (*MessageList_Message) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1135 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1136 | func (this *MessageList_Message) GetName() string { |
| 1137 | if this != nil && this.Name != nil { |
| 1138 | return *this.Name |
| 1139 | } |
| 1140 | return "" |
| 1141 | } |
| 1142 | |
| 1143 | func (this *MessageList_Message) GetCount() int32 { |
| 1144 | if this != nil && this.Count != nil { |
| 1145 | return *this.Count |
| 1146 | } |
| 1147 | return 0 |
| 1148 | } |
| 1149 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1150 | type Strings struct { |
| 1151 | StringField *string `protobuf:"bytes,1,opt,name=string_field" json:"string_field,omitempty"` |
| 1152 | BytesField []byte `protobuf:"bytes,2,opt,name=bytes_field" json:"bytes_field,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1153 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1154 | } |
| 1155 | |
| 1156 | func (this *Strings) Reset() { *this = Strings{} } |
| 1157 | func (this *Strings) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1158 | func (*Strings) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1159 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1160 | func (this *Strings) GetStringField() string { |
| 1161 | if this != nil && this.StringField != nil { |
| 1162 | return *this.StringField |
| 1163 | } |
| 1164 | return "" |
| 1165 | } |
| 1166 | |
| 1167 | func (this *Strings) GetBytesField() []byte { |
| 1168 | if this != nil { |
| 1169 | return this.BytesField |
| 1170 | } |
| 1171 | return nil |
| 1172 | } |
| 1173 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1174 | type Defaults struct { |
| 1175 | F_Bool *bool `protobuf:"varint,1,opt,def=1" json:"F_Bool,omitempty"` |
| 1176 | F_Int32 *int32 `protobuf:"varint,2,opt,def=32" json:"F_Int32,omitempty"` |
| 1177 | F_Int64 *int64 `protobuf:"varint,3,opt,def=64" json:"F_Int64,omitempty"` |
| 1178 | F_Fixed32 *uint32 `protobuf:"fixed32,4,opt,def=320" json:"F_Fixed32,omitempty"` |
| 1179 | F_Fixed64 *uint64 `protobuf:"fixed64,5,opt,def=640" json:"F_Fixed64,omitempty"` |
| 1180 | F_Uint32 *uint32 `protobuf:"varint,6,opt,def=3200" json:"F_Uint32,omitempty"` |
| 1181 | F_Uint64 *uint64 `protobuf:"varint,7,opt,def=6400" json:"F_Uint64,omitempty"` |
| 1182 | F_Float *float32 `protobuf:"fixed32,8,opt,def=314159" json:"F_Float,omitempty"` |
| 1183 | F_Double *float64 `protobuf:"fixed64,9,opt,def=271828" json:"F_Double,omitempty"` |
| 1184 | F_String *string `protobuf:"bytes,10,opt,def=hello, \"world!\"\n" json:"F_String,omitempty"` |
| 1185 | F_Bytes []byte `protobuf:"bytes,11,opt,def=Bignose" json:"F_Bytes,omitempty"` |
| 1186 | F_Sint32 *int32 `protobuf:"zigzag32,12,opt,def=-32" json:"F_Sint32,omitempty"` |
| 1187 | F_Sint64 *int64 `protobuf:"zigzag64,13,opt,def=-64" json:"F_Sint64,omitempty"` |
| 1188 | F_Enum *Defaults_Color `protobuf:"varint,14,opt,enum=testdata.Defaults_Color,def=1" json:"F_Enum,omitempty"` |
| 1189 | F_Pinf *float32 `protobuf:"fixed32,15,opt,def=inf" json:"F_Pinf,omitempty"` |
| 1190 | F_Ninf *float32 `protobuf:"fixed32,16,opt,def=-inf" json:"F_Ninf,omitempty"` |
| 1191 | F_Nan *float32 `protobuf:"fixed32,17,opt,def=nan" json:"F_Nan,omitempty"` |
| 1192 | Sub *SubDefaults `protobuf:"bytes,18,opt,name=sub" json:"sub,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1193 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1194 | } |
| 1195 | |
| 1196 | func (this *Defaults) Reset() { *this = Defaults{} } |
| 1197 | func (this *Defaults) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1198 | func (*Defaults) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1199 | |
| 1200 | const Default_Defaults_F_Bool bool = true |
| 1201 | const Default_Defaults_F_Int32 int32 = 32 |
| 1202 | const Default_Defaults_F_Int64 int64 = 64 |
| 1203 | const Default_Defaults_F_Fixed32 uint32 = 320 |
| 1204 | const Default_Defaults_F_Fixed64 uint64 = 640 |
| 1205 | const Default_Defaults_F_Uint32 uint32 = 3200 |
| 1206 | const Default_Defaults_F_Uint64 uint64 = 6400 |
| 1207 | const Default_Defaults_F_Float float32 = 314159 |
| 1208 | const Default_Defaults_F_Double float64 = 271828 |
| 1209 | const Default_Defaults_F_String string = "hello, \"world!\"\n" |
| 1210 | |
| 1211 | var Default_Defaults_F_Bytes []byte = []byte("Bignose") |
| 1212 | |
| 1213 | const Default_Defaults_F_Sint32 int32 = -32 |
| 1214 | const Default_Defaults_F_Sint64 int64 = -64 |
| 1215 | const Default_Defaults_F_Enum Defaults_Color = Defaults_GREEN |
| 1216 | |
| 1217 | var Default_Defaults_F_Pinf float32 = float32(math.Inf(1)) |
| 1218 | var Default_Defaults_F_Ninf float32 = float32(math.Inf(-1)) |
| 1219 | var Default_Defaults_F_Nan float32 = float32(math.NaN()) |
| 1220 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1221 | func (this *Defaults) GetF_Bool() bool { |
| 1222 | if this != nil && this.F_Bool != nil { |
| 1223 | return *this.F_Bool |
| 1224 | } |
| 1225 | return Default_Defaults_F_Bool |
| 1226 | } |
| 1227 | |
| 1228 | func (this *Defaults) GetF_Int32() int32 { |
| 1229 | if this != nil && this.F_Int32 != nil { |
| 1230 | return *this.F_Int32 |
| 1231 | } |
| 1232 | return Default_Defaults_F_Int32 |
| 1233 | } |
| 1234 | |
| 1235 | func (this *Defaults) GetF_Int64() int64 { |
| 1236 | if this != nil && this.F_Int64 != nil { |
| 1237 | return *this.F_Int64 |
| 1238 | } |
| 1239 | return Default_Defaults_F_Int64 |
| 1240 | } |
| 1241 | |
| 1242 | func (this *Defaults) GetF_Fixed32() uint32 { |
| 1243 | if this != nil && this.F_Fixed32 != nil { |
| 1244 | return *this.F_Fixed32 |
| 1245 | } |
| 1246 | return Default_Defaults_F_Fixed32 |
| 1247 | } |
| 1248 | |
| 1249 | func (this *Defaults) GetF_Fixed64() uint64 { |
| 1250 | if this != nil && this.F_Fixed64 != nil { |
| 1251 | return *this.F_Fixed64 |
| 1252 | } |
| 1253 | return Default_Defaults_F_Fixed64 |
| 1254 | } |
| 1255 | |
| 1256 | func (this *Defaults) GetF_Uint32() uint32 { |
| 1257 | if this != nil && this.F_Uint32 != nil { |
| 1258 | return *this.F_Uint32 |
| 1259 | } |
| 1260 | return Default_Defaults_F_Uint32 |
| 1261 | } |
| 1262 | |
| 1263 | func (this *Defaults) GetF_Uint64() uint64 { |
| 1264 | if this != nil && this.F_Uint64 != nil { |
| 1265 | return *this.F_Uint64 |
| 1266 | } |
| 1267 | return Default_Defaults_F_Uint64 |
| 1268 | } |
| 1269 | |
| 1270 | func (this *Defaults) GetF_Float() float32 { |
| 1271 | if this != nil && this.F_Float != nil { |
| 1272 | return *this.F_Float |
| 1273 | } |
| 1274 | return Default_Defaults_F_Float |
| 1275 | } |
| 1276 | |
| 1277 | func (this *Defaults) GetF_Double() float64 { |
| 1278 | if this != nil && this.F_Double != nil { |
| 1279 | return *this.F_Double |
| 1280 | } |
| 1281 | return Default_Defaults_F_Double |
| 1282 | } |
| 1283 | |
| 1284 | func (this *Defaults) GetF_String() string { |
| 1285 | if this != nil && this.F_String != nil { |
| 1286 | return *this.F_String |
| 1287 | } |
| 1288 | return Default_Defaults_F_String |
| 1289 | } |
| 1290 | |
| 1291 | func (this *Defaults) GetF_Bytes() []byte { |
| 1292 | if this != nil && this.F_Bytes != nil { |
| 1293 | return this.F_Bytes |
| 1294 | } |
| 1295 | return append([]byte(nil), Default_Defaults_F_Bytes...) |
| 1296 | } |
| 1297 | |
| 1298 | func (this *Defaults) GetF_Sint32() int32 { |
| 1299 | if this != nil && this.F_Sint32 != nil { |
| 1300 | return *this.F_Sint32 |
| 1301 | } |
| 1302 | return Default_Defaults_F_Sint32 |
| 1303 | } |
| 1304 | |
| 1305 | func (this *Defaults) GetF_Sint64() int64 { |
| 1306 | if this != nil && this.F_Sint64 != nil { |
| 1307 | return *this.F_Sint64 |
| 1308 | } |
| 1309 | return Default_Defaults_F_Sint64 |
| 1310 | } |
| 1311 | |
| 1312 | func (this *Defaults) GetF_Enum() Defaults_Color { |
| 1313 | if this != nil && this.F_Enum != nil { |
| 1314 | return *this.F_Enum |
| 1315 | } |
| 1316 | return Default_Defaults_F_Enum |
| 1317 | } |
| 1318 | |
| 1319 | func (this *Defaults) GetF_Pinf() float32 { |
| 1320 | if this != nil && this.F_Pinf != nil { |
| 1321 | return *this.F_Pinf |
| 1322 | } |
| 1323 | return Default_Defaults_F_Pinf |
| 1324 | } |
| 1325 | |
| 1326 | func (this *Defaults) GetF_Ninf() float32 { |
| 1327 | if this != nil && this.F_Ninf != nil { |
| 1328 | return *this.F_Ninf |
| 1329 | } |
| 1330 | return Default_Defaults_F_Ninf |
| 1331 | } |
| 1332 | |
| 1333 | func (this *Defaults) GetF_Nan() float32 { |
| 1334 | if this != nil && this.F_Nan != nil { |
| 1335 | return *this.F_Nan |
| 1336 | } |
| 1337 | return Default_Defaults_F_Nan |
| 1338 | } |
| 1339 | |
| 1340 | func (this *Defaults) GetSub() *SubDefaults { |
| 1341 | if this != nil { |
| 1342 | return this.Sub |
| 1343 | } |
| 1344 | return nil |
| 1345 | } |
| 1346 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1347 | type SubDefaults struct { |
| 1348 | N *int64 `protobuf:"varint,1,opt,name=n,def=7" json:"n,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1349 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1350 | } |
| 1351 | |
| 1352 | func (this *SubDefaults) Reset() { *this = SubDefaults{} } |
| 1353 | func (this *SubDefaults) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1354 | func (*SubDefaults) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1355 | |
| 1356 | const Default_SubDefaults_N int64 = 7 |
| 1357 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1358 | func (this *SubDefaults) GetN() int64 { |
| 1359 | if this != nil && this.N != nil { |
| 1360 | return *this.N |
| 1361 | } |
| 1362 | return Default_SubDefaults_N |
| 1363 | } |
| 1364 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1365 | type RepeatedEnum struct { |
| 1366 | Color []RepeatedEnum_Color `protobuf:"varint,1,rep,name=color,enum=testdata.RepeatedEnum_Color" json:"color,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1367 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1368 | } |
| 1369 | |
| 1370 | func (this *RepeatedEnum) Reset() { *this = RepeatedEnum{} } |
| 1371 | func (this *RepeatedEnum) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1372 | func (*RepeatedEnum) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1373 | |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1374 | var E_Greeting = &proto.ExtensionDesc{ |
| 1375 | ExtendedType: (*MyMessage)(nil), |
| 1376 | ExtensionType: ([]string)(nil), |
| 1377 | Field: 106, |
| 1378 | Name: "testdata.greeting", |
| 1379 | Tag: "bytes,106,rep,name=greeting", |
| 1380 | } |
| 1381 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1382 | func init() { |
| 1383 | proto.RegisterEnum("testdata.FOO", FOO_name, FOO_value) |
| 1384 | proto.RegisterEnum("testdata.GoTest_KIND", GoTest_KIND_name, GoTest_KIND_value) |
| 1385 | proto.RegisterEnum("testdata.MyMessage_Color", MyMessage_Color_name, MyMessage_Color_value) |
| 1386 | proto.RegisterEnum("testdata.Defaults_Color", Defaults_Color_name, Defaults_Color_value) |
| 1387 | proto.RegisterEnum("testdata.RepeatedEnum_Color", RepeatedEnum_Color_name, RepeatedEnum_Color_value) |
| 1388 | proto.RegisterExtension(E_Ext_More) |
| 1389 | proto.RegisterExtension(E_Ext_Text) |
| 1390 | proto.RegisterExtension(E_Ext_Number) |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1391 | proto.RegisterExtension(E_Greeting) |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1392 | } |