| 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 { |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 688 | RequiredField *string `protobuf:"bytes,71,req" json:"RequiredField,omitempty"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 689 | } |
| 690 | |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 691 | func (this *GoTest_RequiredGroup) Reset() { *this = GoTest_RequiredGroup{} } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 692 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 693 | func (this *GoTest_RequiredGroup) GetRequiredField() string { |
| 694 | if this != nil && this.RequiredField != nil { |
| 695 | return *this.RequiredField |
| 696 | } |
| 697 | return "" |
| 698 | } |
| 699 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 700 | type GoTest_RepeatedGroup struct { |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 701 | RequiredField *string `protobuf:"bytes,81,req" json:"RequiredField,omitempty"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 702 | } |
| 703 | |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 704 | func (this *GoTest_RepeatedGroup) Reset() { *this = GoTest_RepeatedGroup{} } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 705 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 706 | func (this *GoTest_RepeatedGroup) GetRequiredField() string { |
| 707 | if this != nil && this.RequiredField != nil { |
| 708 | return *this.RequiredField |
| 709 | } |
| 710 | return "" |
| 711 | } |
| 712 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 713 | type GoTest_OptionalGroup struct { |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 714 | RequiredField *string `protobuf:"bytes,91,req" json:"RequiredField,omitempty"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 715 | } |
| 716 | |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 717 | func (this *GoTest_OptionalGroup) Reset() { *this = GoTest_OptionalGroup{} } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 718 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 719 | func (this *GoTest_OptionalGroup) GetRequiredField() string { |
| 720 | if this != nil && this.RequiredField != nil { |
| 721 | return *this.RequiredField |
| 722 | } |
| 723 | return "" |
| 724 | } |
| 725 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 726 | type 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 Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 732 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 733 | } |
| 734 | |
| 735 | func (this *GoSkipTest) Reset() { *this = GoSkipTest{} } |
| 736 | func (this *GoSkipTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 737 | func (*GoSkipTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 738 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 739 | func (this *GoSkipTest) GetSkipInt32() int32 { |
| 740 | if this != nil && this.SkipInt32 != nil { |
| 741 | return *this.SkipInt32 |
| 742 | } |
| 743 | return 0 |
| 744 | } |
| 745 | |
| 746 | func (this *GoSkipTest) GetSkipFixed32() uint32 { |
| 747 | if this != nil && this.SkipFixed32 != nil { |
| 748 | return *this.SkipFixed32 |
| 749 | } |
| 750 | return 0 |
| 751 | } |
| 752 | |
| 753 | func (this *GoSkipTest) GetSkipFixed64() uint64 { |
| 754 | if this != nil && this.SkipFixed64 != nil { |
| 755 | return *this.SkipFixed64 |
| 756 | } |
| 757 | return 0 |
| 758 | } |
| 759 | |
| 760 | func (this *GoSkipTest) GetSkipString() string { |
| 761 | if this != nil && this.SkipString != nil { |
| 762 | return *this.SkipString |
| 763 | } |
| 764 | return "" |
| 765 | } |
| 766 | |
| 767 | func (this *GoSkipTest) GetSkipgroup() *GoSkipTest_SkipGroup { |
| 768 | if this != nil { |
| 769 | return this.Skipgroup |
| 770 | } |
| 771 | return nil |
| 772 | } |
| 773 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 774 | type GoSkipTest_SkipGroup struct { |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 775 | 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 Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 777 | } |
| 778 | |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 779 | func (this *GoSkipTest_SkipGroup) Reset() { *this = GoSkipTest_SkipGroup{} } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 780 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 781 | func (this *GoSkipTest_SkipGroup) GetGroupInt32() int32 { |
| 782 | if this != nil && this.GroupInt32 != nil { |
| 783 | return *this.GroupInt32 |
| 784 | } |
| 785 | return 0 |
| 786 | } |
| 787 | |
| 788 | func (this *GoSkipTest_SkipGroup) GetGroupString() string { |
| 789 | if this != nil && this.GroupString != nil { |
| 790 | return *this.GroupString |
| 791 | } |
| 792 | return "" |
| 793 | } |
| 794 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 795 | type NonPackedTest struct { |
| 796 | A []int32 `protobuf:"varint,1,rep,name=a" json:"a,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 797 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 798 | } |
| 799 | |
| 800 | func (this *NonPackedTest) Reset() { *this = NonPackedTest{} } |
| 801 | func (this *NonPackedTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 802 | func (*NonPackedTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 803 | |
| 804 | type PackedTest struct { |
| 805 | B []int32 `protobuf:"varint,1,rep,packed,name=b" json:"b,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 806 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 807 | } |
| 808 | |
| 809 | func (this *PackedTest) Reset() { *this = PackedTest{} } |
| 810 | func (this *PackedTest) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 811 | func (*PackedTest) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 812 | |
| 813 | type MaxTag struct { |
| 814 | 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] | 815 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 816 | } |
| 817 | |
| 818 | func (this *MaxTag) Reset() { *this = MaxTag{} } |
| 819 | func (this *MaxTag) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 820 | func (*MaxTag) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 821 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 822 | func (this *MaxTag) GetLastField() string { |
| 823 | if this != nil && this.LastField != nil { |
| 824 | return *this.LastField |
| 825 | } |
| 826 | return "" |
| 827 | } |
| 828 | |
| David Symonds | 10c93ba | 2012-08-04 16:38:08 +1000 | [diff] [blame] | 829 | type OldMessage struct { |
| 830 | Nested *OldMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` |
| 831 | XXX_unrecognized []byte `json:"-"` |
| 832 | } |
| 833 | |
| 834 | func (this *OldMessage) Reset() { *this = OldMessage{} } |
| 835 | func (this *OldMessage) String() string { return proto.CompactTextString(this) } |
| 836 | func (*OldMessage) ProtoMessage() {} |
| 837 | |
| 838 | func (this *OldMessage) GetNested() *OldMessage_Nested { |
| 839 | if this != nil { |
| 840 | return this.Nested |
| 841 | } |
| 842 | return nil |
| 843 | } |
| 844 | |
| 845 | type OldMessage_Nested struct { |
| 846 | Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` |
| 847 | XXX_unrecognized []byte `json:"-"` |
| 848 | } |
| 849 | |
| 850 | func (this *OldMessage_Nested) Reset() { *this = OldMessage_Nested{} } |
| 851 | func (this *OldMessage_Nested) String() string { return proto.CompactTextString(this) } |
| 852 | func (*OldMessage_Nested) ProtoMessage() {} |
| 853 | |
| 854 | func (this *OldMessage_Nested) GetName() string { |
| 855 | if this != nil && this.Name != nil { |
| 856 | return *this.Name |
| 857 | } |
| 858 | return "" |
| 859 | } |
| 860 | |
| 861 | type NewMessage struct { |
| 862 | Nested *NewMessage_Nested `protobuf:"bytes,1,opt,name=nested" json:"nested,omitempty"` |
| 863 | XXX_unrecognized []byte `json:"-"` |
| 864 | } |
| 865 | |
| 866 | func (this *NewMessage) Reset() { *this = NewMessage{} } |
| 867 | func (this *NewMessage) String() string { return proto.CompactTextString(this) } |
| 868 | func (*NewMessage) ProtoMessage() {} |
| 869 | |
| 870 | func (this *NewMessage) GetNested() *NewMessage_Nested { |
| 871 | if this != nil { |
| 872 | return this.Nested |
| 873 | } |
| 874 | return nil |
| 875 | } |
| 876 | |
| 877 | type 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 | |
| 883 | func (this *NewMessage_Nested) Reset() { *this = NewMessage_Nested{} } |
| 884 | func (this *NewMessage_Nested) String() string { return proto.CompactTextString(this) } |
| 885 | func (*NewMessage_Nested) ProtoMessage() {} |
| 886 | |
| 887 | func (this *NewMessage_Nested) GetName() string { |
| 888 | if this != nil && this.Name != nil { |
| 889 | return *this.Name |
| 890 | } |
| 891 | return "" |
| 892 | } |
| 893 | |
| 894 | func (this *NewMessage_Nested) GetFoodGroup() string { |
| 895 | if this != nil && this.FoodGroup != nil { |
| 896 | return *this.FoodGroup |
| 897 | } |
| 898 | return "" |
| 899 | } |
| 900 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 901 | type 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 Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 905 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 906 | } |
| 907 | |
| 908 | func (this *InnerMessage) Reset() { *this = InnerMessage{} } |
| 909 | func (this *InnerMessage) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 910 | func (*InnerMessage) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 911 | |
| 912 | const Default_InnerMessage_Port int32 = 4000 |
| 913 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 914 | func (this *InnerMessage) GetHost() string { |
| 915 | if this != nil && this.Host != nil { |
| 916 | return *this.Host |
| 917 | } |
| 918 | return "" |
| 919 | } |
| 920 | |
| 921 | func (this *InnerMessage) GetPort() int32 { |
| 922 | if this != nil && this.Port != nil { |
| 923 | return *this.Port |
| 924 | } |
| 925 | return Default_InnerMessage_Port |
| 926 | } |
| 927 | |
| 928 | func (this *InnerMessage) GetConnected() bool { |
| 929 | if this != nil && this.Connected != nil { |
| 930 | return *this.Connected |
| 931 | } |
| 932 | return false |
| 933 | } |
| 934 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 935 | type 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 Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 940 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 941 | } |
| 942 | |
| 943 | func (this *OtherMessage) Reset() { *this = OtherMessage{} } |
| 944 | func (this *OtherMessage) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 945 | func (*OtherMessage) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 946 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 947 | func (this *OtherMessage) GetKey() int64 { |
| 948 | if this != nil && this.Key != nil { |
| 949 | return *this.Key |
| 950 | } |
| 951 | return 0 |
| 952 | } |
| 953 | |
| 954 | func (this *OtherMessage) GetValue() []byte { |
| 955 | if this != nil { |
| 956 | return this.Value |
| 957 | } |
| 958 | return nil |
| 959 | } |
| 960 | |
| 961 | func (this *OtherMessage) GetWeight() float32 { |
| 962 | if this != nil && this.Weight != nil { |
| 963 | return *this.Weight |
| 964 | } |
| 965 | return 0 |
| 966 | } |
| 967 | |
| 968 | func (this *OtherMessage) GetInner() *InnerMessage { |
| 969 | if this != nil { |
| 970 | return this.Inner |
| 971 | } |
| 972 | return nil |
| 973 | } |
| 974 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 975 | type 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 Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 985 | XXX_extensions map[int32]proto.Extension `json:"-"` |
| 986 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 987 | } |
| 988 | |
| 989 | func (this *MyMessage) Reset() { *this = MyMessage{} } |
| 990 | func (this *MyMessage) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 991 | func (*MyMessage) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 992 | |
| 993 | var extRange_MyMessage = []proto.ExtensionRange{ |
| 994 | {100, 536870911}, |
| 995 | } |
| 996 | |
| 997 | func (*MyMessage) ExtensionRangeArray() []proto.ExtensionRange { |
| 998 | return extRange_MyMessage |
| 999 | } |
| 1000 | func (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 Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1007 | func (this *MyMessage) GetCount() int32 { |
| 1008 | if this != nil && this.Count != nil { |
| 1009 | return *this.Count |
| 1010 | } |
| 1011 | return 0 |
| 1012 | } |
| 1013 | |
| 1014 | func (this *MyMessage) GetName() string { |
| 1015 | if this != nil && this.Name != nil { |
| 1016 | return *this.Name |
| 1017 | } |
| 1018 | return "" |
| 1019 | } |
| 1020 | |
| 1021 | func (this *MyMessage) GetQuote() string { |
| 1022 | if this != nil && this.Quote != nil { |
| 1023 | return *this.Quote |
| 1024 | } |
| 1025 | return "" |
| 1026 | } |
| 1027 | |
| 1028 | func (this *MyMessage) GetInner() *InnerMessage { |
| 1029 | if this != nil { |
| 1030 | return this.Inner |
| 1031 | } |
| 1032 | return nil |
| 1033 | } |
| 1034 | |
| 1035 | func (this *MyMessage) GetBikeshed() MyMessage_Color { |
| 1036 | if this != nil && this.Bikeshed != nil { |
| 1037 | return *this.Bikeshed |
| 1038 | } |
| 1039 | return 0 |
| 1040 | } |
| 1041 | |
| 1042 | func (this *MyMessage) GetSomegroup() *MyMessage_SomeGroup { |
| 1043 | if this != nil { |
| 1044 | return this.Somegroup |
| 1045 | } |
| 1046 | return nil |
| 1047 | } |
| 1048 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1049 | type MyMessage_SomeGroup struct { |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 1050 | GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1051 | } |
| 1052 | |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 1053 | func (this *MyMessage_SomeGroup) Reset() { *this = MyMessage_SomeGroup{} } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1054 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1055 | func (this *MyMessage_SomeGroup) GetGroupField() int32 { |
| 1056 | if this != nil && this.GroupField != nil { |
| 1057 | return *this.GroupField |
| 1058 | } |
| 1059 | return 0 |
| 1060 | } |
| 1061 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1062 | type Ext struct { |
| 1063 | Data *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1064 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1065 | } |
| 1066 | |
| 1067 | func (this *Ext) Reset() { *this = Ext{} } |
| 1068 | func (this *Ext) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1069 | func (*Ext) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1070 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1071 | func (this *Ext) GetData() string { |
| 1072 | if this != nil && this.Data != nil { |
| 1073 | return *this.Data |
| 1074 | } |
| 1075 | return "" |
| 1076 | } |
| 1077 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1078 | var 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 | |
| 1086 | var 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 | |
| 1094 | var 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 | |
| 1102 | type MessageList struct { |
| 1103 | Message []*MessageList_Message `protobuf:"group,1,rep" json:"message,omitempty"` |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1104 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1105 | } |
| 1106 | |
| 1107 | func (this *MessageList) Reset() { *this = MessageList{} } |
| 1108 | func (this *MessageList) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1109 | func (*MessageList) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1110 | |
| 1111 | type MessageList_Message struct { |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 1112 | Name *string `protobuf:"bytes,2,req,name=name" json:"name,omitempty"` |
| 1113 | Count *int32 `protobuf:"varint,3,req,name=count" json:"count,omitempty"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1114 | } |
| 1115 | |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 1116 | func (this *MessageList_Message) Reset() { *this = MessageList_Message{} } |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1117 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1118 | func (this *MessageList_Message) GetName() string { |
| 1119 | if this != nil && this.Name != nil { |
| 1120 | return *this.Name |
| 1121 | } |
| 1122 | return "" |
| 1123 | } |
| 1124 | |
| 1125 | func (this *MessageList_Message) GetCount() int32 { |
| 1126 | if this != nil && this.Count != nil { |
| 1127 | return *this.Count |
| 1128 | } |
| 1129 | return 0 |
| 1130 | } |
| 1131 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1132 | type 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 Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1135 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1136 | } |
| 1137 | |
| 1138 | func (this *Strings) Reset() { *this = Strings{} } |
| 1139 | func (this *Strings) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1140 | func (*Strings) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1141 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1142 | func (this *Strings) GetStringField() string { |
| 1143 | if this != nil && this.StringField != nil { |
| 1144 | return *this.StringField |
| 1145 | } |
| 1146 | return "" |
| 1147 | } |
| 1148 | |
| 1149 | func (this *Strings) GetBytesField() []byte { |
| 1150 | if this != nil { |
| 1151 | return this.BytesField |
| 1152 | } |
| 1153 | return nil |
| 1154 | } |
| 1155 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1156 | type 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 Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1175 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1176 | } |
| 1177 | |
| 1178 | func (this *Defaults) Reset() { *this = Defaults{} } |
| 1179 | func (this *Defaults) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1180 | func (*Defaults) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1181 | |
| 1182 | const Default_Defaults_F_Bool bool = true |
| 1183 | const Default_Defaults_F_Int32 int32 = 32 |
| 1184 | const Default_Defaults_F_Int64 int64 = 64 |
| 1185 | const Default_Defaults_F_Fixed32 uint32 = 320 |
| 1186 | const Default_Defaults_F_Fixed64 uint64 = 640 |
| 1187 | const Default_Defaults_F_Uint32 uint32 = 3200 |
| 1188 | const Default_Defaults_F_Uint64 uint64 = 6400 |
| 1189 | const Default_Defaults_F_Float float32 = 314159 |
| 1190 | const Default_Defaults_F_Double float64 = 271828 |
| 1191 | const Default_Defaults_F_String string = "hello, \"world!\"\n" |
| 1192 | |
| 1193 | var Default_Defaults_F_Bytes []byte = []byte("Bignose") |
| 1194 | |
| 1195 | const Default_Defaults_F_Sint32 int32 = -32 |
| 1196 | const Default_Defaults_F_Sint64 int64 = -64 |
| 1197 | const Default_Defaults_F_Enum Defaults_Color = Defaults_GREEN |
| 1198 | |
| 1199 | var Default_Defaults_F_Pinf float32 = float32(math.Inf(1)) |
| 1200 | var Default_Defaults_F_Ninf float32 = float32(math.Inf(-1)) |
| 1201 | var Default_Defaults_F_Nan float32 = float32(math.NaN()) |
| 1202 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1203 | func (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 | |
| 1210 | func (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 | |
| 1217 | func (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 | |
| 1224 | func (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 | |
| 1231 | func (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 | |
| 1238 | func (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 | |
| 1245 | func (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 | |
| 1252 | func (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 | |
| 1259 | func (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 | |
| 1266 | func (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 | |
| 1273 | func (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 | |
| 1280 | func (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 | |
| 1287 | func (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 | |
| 1294 | func (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 | |
| 1301 | func (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 | |
| 1308 | func (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 | |
| 1315 | func (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 | |
| 1322 | func (this *Defaults) GetSub() *SubDefaults { |
| 1323 | if this != nil { |
| 1324 | return this.Sub |
| 1325 | } |
| 1326 | return nil |
| 1327 | } |
| 1328 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1329 | type SubDefaults struct { |
| 1330 | 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] | 1331 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1332 | } |
| 1333 | |
| 1334 | func (this *SubDefaults) Reset() { *this = SubDefaults{} } |
| 1335 | func (this *SubDefaults) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1336 | func (*SubDefaults) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1337 | |
| 1338 | const Default_SubDefaults_N int64 = 7 |
| 1339 | |
| David Symonds | 0e08492 | 2012-07-02 16:04:40 -0700 | [diff] [blame] | 1340 | func (this *SubDefaults) GetN() int64 { |
| 1341 | if this != nil && this.N != nil { |
| 1342 | return *this.N |
| 1343 | } |
| 1344 | return Default_SubDefaults_N |
| 1345 | } |
| 1346 | |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1347 | type RepeatedEnum struct { |
| 1348 | 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] | 1349 | XXX_unrecognized []byte `json:"-"` |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1350 | } |
| 1351 | |
| 1352 | func (this *RepeatedEnum) Reset() { *this = RepeatedEnum{} } |
| 1353 | func (this *RepeatedEnum) String() string { return proto.CompactTextString(this) } |
| David Symonds | 9f60f43 | 2012-06-14 09:45:25 +1000 | [diff] [blame] | 1354 | func (*RepeatedEnum) ProtoMessage() {} |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1355 | |
| David Symonds | fc16c2c | 2012-11-07 23:41:17 +1100 | [diff] [blame^] | 1356 | type 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 | |
| 1365 | func (this *MoreRepeated) Reset() { *this = MoreRepeated{} } |
| 1366 | func (this *MoreRepeated) String() string { return proto.CompactTextString(this) } |
| 1367 | func (*MoreRepeated) ProtoMessage() {} |
| 1368 | |
| David Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1369 | var 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 Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1377 | func 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 Symonds | 61826da | 2012-05-05 09:31:28 +1000 | [diff] [blame] | 1386 | proto.RegisterExtension(E_Greeting) |
| Rob Pike | b7907bf | 2012-02-13 14:25:20 +1100 | [diff] [blame] | 1387 | } |