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