1// Code generated by protoc-gen-go. DO NOT EDIT. 2// source: my_test/test.proto 3 4/* 5Package my_test is a generated protocol buffer package. 6 7This package holds interesting messages. 8 9It is generated from these files: 10 my_test/test.proto 11 12It has these top-level messages: 13 Request 14 Reply 15 OtherBase 16 ReplyExtensions 17 OtherReplyExtensions 18 OldReply 19 Communique 20*/ 21package my_test 22 23import proto "github.com/golang/protobuf/proto" 24import fmt "fmt" 25import math "math" 26import _ "github.com/golang/protobuf/protoc-gen-go/testdata/multi" 27 28// Reference imports to suppress errors if they are not otherwise used. 29var _ = proto.Marshal 30var _ = fmt.Errorf 31var _ = math.Inf 32 33// This is a compile-time assertion to ensure that this generated file 34// is compatible with the proto package it is being compiled against. 35// A compilation error at this line likely means your copy of the 36// proto package needs to be updated. 37const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 38 39type HatType int32 40 41const ( 42 // deliberately skipping 0 43 HatType_FEDORA HatType = 1 44 HatType_FEZ HatType = 2 45) 46 47var HatType_name = map[int32]string{ 48 1: "FEDORA", 49 2: "FEZ", 50} 51var HatType_value = map[string]int32{ 52 "FEDORA": 1, 53 "FEZ": 2, 54} 55 56func (x HatType) Enum() *HatType { 57 p := new(HatType) 58 *p = x 59 return p 60} 61func (x HatType) String() string { 62 return proto.EnumName(HatType_name, int32(x)) 63} 64func (x *HatType) UnmarshalJSON(data []byte) error { 65 value, err := proto.UnmarshalJSONEnum(HatType_value, data, "HatType") 66 if err != nil { 67 return err 68 } 69 *x = HatType(value) 70 return nil 71} 72 73// This enum represents days of the week. 74type Days int32 75 76const ( 77 Days_MONDAY Days = 1 78 Days_TUESDAY Days = 2 79 Days_LUNDI Days = 1 80) 81 82var Days_name = map[int32]string{ 83 1: "MONDAY", 84 2: "TUESDAY", 85 // Duplicate value: 1: "LUNDI", 86} 87var Days_value = map[string]int32{ 88 "MONDAY": 1, 89 "TUESDAY": 2, 90 "LUNDI": 1, 91} 92 93func (x Days) Enum() *Days { 94 p := new(Days) 95 *p = x 96 return p 97} 98func (x Days) String() string { 99 return proto.EnumName(Days_name, int32(x)) 100} 101func (x *Days) UnmarshalJSON(data []byte) error { 102 value, err := proto.UnmarshalJSONEnum(Days_value, data, "Days") 103 if err != nil { 104 return err 105 } 106 *x = Days(value) 107 return nil 108} 109 110type Request_Color int32 111 112const ( 113 Request_RED Request_Color = 0 114 Request_GREEN Request_Color = 1 115 Request_BLUE Request_Color = 2 116) 117 118var Request_Color_name = map[int32]string{ 119 0: "RED", 120 1: "GREEN", 121 2: "BLUE", 122} 123var Request_Color_value = map[string]int32{ 124 "RED": 0, 125 "GREEN": 1, 126 "BLUE": 2, 127} 128 129func (x Request_Color) Enum() *Request_Color { 130 p := new(Request_Color) 131 *p = x 132 return p 133} 134func (x Request_Color) String() string { 135 return proto.EnumName(Request_Color_name, int32(x)) 136} 137func (x *Request_Color) UnmarshalJSON(data []byte) error { 138 value, err := proto.UnmarshalJSONEnum(Request_Color_value, data, "Request_Color") 139 if err != nil { 140 return err 141 } 142 *x = Request_Color(value) 143 return nil 144} 145 146type Reply_Entry_Game int32 147 148const ( 149 Reply_Entry_FOOTBALL Reply_Entry_Game = 1 150 Reply_Entry_TENNIS Reply_Entry_Game = 2 151) 152 153var Reply_Entry_Game_name = map[int32]string{ 154 1: "FOOTBALL", 155 2: "TENNIS", 156} 157var Reply_Entry_Game_value = map[string]int32{ 158 "FOOTBALL": 1, 159 "TENNIS": 2, 160} 161 162func (x Reply_Entry_Game) Enum() *Reply_Entry_Game { 163 p := new(Reply_Entry_Game) 164 *p = x 165 return p 166} 167func (x Reply_Entry_Game) String() string { 168 return proto.EnumName(Reply_Entry_Game_name, int32(x)) 169} 170func (x *Reply_Entry_Game) UnmarshalJSON(data []byte) error { 171 value, err := proto.UnmarshalJSONEnum(Reply_Entry_Game_value, data, "Reply_Entry_Game") 172 if err != nil { 173 return err 174 } 175 *x = Reply_Entry_Game(value) 176 return nil 177} 178 179// This is a message that might be sent somewhere. 180type Request struct { 181 Key []int64 `protobuf:"varint,1,rep,name=key" json:"key,omitempty"` 182 // optional imp.ImportedMessage imported_message = 2; 183 Hue *Request_Color `protobuf:"varint,3,opt,name=hue,enum=my.test.Request_Color" json:"hue,omitempty"` 184 Hat *HatType `protobuf:"varint,4,opt,name=hat,enum=my.test.HatType,def=1" json:"hat,omitempty"` 185 // optional imp.ImportedMessage.Owner owner = 6; 186 Deadline *float32 `protobuf:"fixed32,7,opt,name=deadline,def=inf" json:"deadline,omitempty"` 187 Somegroup *Request_SomeGroup `protobuf:"group,8,opt,name=SomeGroup,json=somegroup" json:"somegroup,omitempty"` 188 // This is a map field. It will generate map[int32]string. 189 NameMapping map[int32]string `protobuf:"bytes,14,rep,name=name_mapping,json=nameMapping" json:"name_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` 190 // This is a map field whose value type is a message. 191 MsgMapping map[int64]*Reply `protobuf:"bytes,15,rep,name=msg_mapping,json=msgMapping" json:"msg_mapping,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` 192 Reset_ *int32 `protobuf:"varint,12,opt,name=reset" json:"reset,omitempty"` 193 // This field should not conflict with any getters. 194 GetKey_ *string `protobuf:"bytes,16,opt,name=get_key,json=getKey" json:"get_key,omitempty"` 195 XXX_unrecognized []byte `json:"-"` 196} 197 198func (m *Request) Reset() { *m = Request{} } 199func (m *Request) String() string { return proto.CompactTextString(m) } 200func (*Request) ProtoMessage() {} 201 202const Default_Request_Hat HatType = HatType_FEDORA 203 204var Default_Request_Deadline float32 = float32(math.Inf(1)) 205 206func (m *Request) GetKey() []int64 { 207 if m != nil { 208 return m.Key 209 } 210 return nil 211} 212 213func (m *Request) GetHue() Request_Color { 214 if m != nil && m.Hue != nil { 215 return *m.Hue 216 } 217 return Request_RED 218} 219 220func (m *Request) GetHat() HatType { 221 if m != nil && m.Hat != nil { 222 return *m.Hat 223 } 224 return Default_Request_Hat 225} 226 227func (m *Request) GetDeadline() float32 { 228 if m != nil && m.Deadline != nil { 229 return *m.Deadline 230 } 231 return Default_Request_Deadline 232} 233 234func (m *Request) GetSomegroup() *Request_SomeGroup { 235 if m != nil { 236 return m.Somegroup 237 } 238 return nil 239} 240 241func (m *Request) GetNameMapping() map[int32]string { 242 if m != nil { 243 return m.NameMapping 244 } 245 return nil 246} 247 248func (m *Request) GetMsgMapping() map[int64]*Reply { 249 if m != nil { 250 return m.MsgMapping 251 } 252 return nil 253} 254 255func (m *Request) GetReset_() int32 { 256 if m != nil && m.Reset_ != nil { 257 return *m.Reset_ 258 } 259 return 0 260} 261 262func (m *Request) GetGetKey_() string { 263 if m != nil && m.GetKey_ != nil { 264 return *m.GetKey_ 265 } 266 return "" 267} 268 269type Request_SomeGroup struct { 270 GroupField *int32 `protobuf:"varint,9,opt,name=group_field,json=groupField" json:"group_field,omitempty"` 271 XXX_unrecognized []byte `json:"-"` 272} 273 274func (m *Request_SomeGroup) Reset() { *m = Request_SomeGroup{} } 275func (m *Request_SomeGroup) String() string { return proto.CompactTextString(m) } 276func (*Request_SomeGroup) ProtoMessage() {} 277 278func (m *Request_SomeGroup) GetGroupField() int32 { 279 if m != nil && m.GroupField != nil { 280 return *m.GroupField 281 } 282 return 0 283} 284 285type Reply struct { 286 Found []*Reply_Entry `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"` 287 CompactKeys []int32 `protobuf:"varint,2,rep,packed,name=compact_keys,json=compactKeys" json:"compact_keys,omitempty"` 288 proto.XXX_InternalExtensions `json:"-"` 289 XXX_unrecognized []byte `json:"-"` 290} 291 292func (m *Reply) Reset() { *m = Reply{} } 293func (m *Reply) String() string { return proto.CompactTextString(m) } 294func (*Reply) ProtoMessage() {} 295 296var extRange_Reply = []proto.ExtensionRange{ 297 {100, 536870911}, 298} 299 300func (*Reply) ExtensionRangeArray() []proto.ExtensionRange { 301 return extRange_Reply 302} 303 304func (m *Reply) GetFound() []*Reply_Entry { 305 if m != nil { 306 return m.Found 307 } 308 return nil 309} 310 311func (m *Reply) GetCompactKeys() []int32 { 312 if m != nil { 313 return m.CompactKeys 314 } 315 return nil 316} 317 318type Reply_Entry struct { 319 KeyThatNeeds_1234Camel_CasIng *int64 `protobuf:"varint,1,req,name=key_that_needs_1234camel_CasIng,json=keyThatNeeds1234camelCasIng" json:"key_that_needs_1234camel_CasIng,omitempty"` 320 Value *int64 `protobuf:"varint,2,opt,name=value,def=7" json:"value,omitempty"` 321 XMyFieldName_2 *int64 `protobuf:"varint,3,opt,name=_my_field_name_2,json=MyFieldName2" json:"_my_field_name_2,omitempty"` 322 XXX_unrecognized []byte `json:"-"` 323} 324 325func (m *Reply_Entry) Reset() { *m = Reply_Entry{} } 326func (m *Reply_Entry) String() string { return proto.CompactTextString(m) } 327func (*Reply_Entry) ProtoMessage() {} 328 329const Default_Reply_Entry_Value int64 = 7 330 331func (m *Reply_Entry) GetKeyThatNeeds_1234Camel_CasIng() int64 { 332 if m != nil && m.KeyThatNeeds_1234Camel_CasIng != nil { 333 return *m.KeyThatNeeds_1234Camel_CasIng 334 } 335 return 0 336} 337 338func (m *Reply_Entry) GetValue() int64 { 339 if m != nil && m.Value != nil { 340 return *m.Value 341 } 342 return Default_Reply_Entry_Value 343} 344 345func (m *Reply_Entry) GetXMyFieldName_2() int64 { 346 if m != nil && m.XMyFieldName_2 != nil { 347 return *m.XMyFieldName_2 348 } 349 return 0 350} 351 352type OtherBase struct { 353 Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` 354 proto.XXX_InternalExtensions `json:"-"` 355 XXX_unrecognized []byte `json:"-"` 356} 357 358func (m *OtherBase) Reset() { *m = OtherBase{} } 359func (m *OtherBase) String() string { return proto.CompactTextString(m) } 360func (*OtherBase) ProtoMessage() {} 361 362var extRange_OtherBase = []proto.ExtensionRange{ 363 {100, 536870911}, 364} 365 366func (*OtherBase) ExtensionRangeArray() []proto.ExtensionRange { 367 return extRange_OtherBase 368} 369 370func (m *OtherBase) GetName() string { 371 if m != nil && m.Name != nil { 372 return *m.Name 373 } 374 return "" 375} 376 377type ReplyExtensions struct { 378 XXX_unrecognized []byte `json:"-"` 379} 380 381func (m *ReplyExtensions) Reset() { *m = ReplyExtensions{} } 382func (m *ReplyExtensions) String() string { return proto.CompactTextString(m) } 383func (*ReplyExtensions) ProtoMessage() {} 384 385var E_ReplyExtensions_Time = &proto.ExtensionDesc{ 386 ExtendedType: (*Reply)(nil), 387 ExtensionType: (*float64)(nil), 388 Field: 101, 389 Name: "my.test.ReplyExtensions.time", 390 Tag: "fixed64,101,opt,name=time", 391 Filename: "my_test/test.proto", 392} 393 394var E_ReplyExtensions_Carrot = &proto.ExtensionDesc{ 395 ExtendedType: (*Reply)(nil), 396 ExtensionType: (*ReplyExtensions)(nil), 397 Field: 105, 398 Name: "my.test.ReplyExtensions.carrot", 399 Tag: "bytes,105,opt,name=carrot", 400 Filename: "my_test/test.proto", 401} 402 403var E_ReplyExtensions_Donut = &proto.ExtensionDesc{ 404 ExtendedType: (*OtherBase)(nil), 405 ExtensionType: (*ReplyExtensions)(nil), 406 Field: 101, 407 Name: "my.test.ReplyExtensions.donut", 408 Tag: "bytes,101,opt,name=donut", 409 Filename: "my_test/test.proto", 410} 411 412type OtherReplyExtensions struct { 413 Key *int32 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"` 414 XXX_unrecognized []byte `json:"-"` 415} 416 417func (m *OtherReplyExtensions) Reset() { *m = OtherReplyExtensions{} } 418func (m *OtherReplyExtensions) String() string { return proto.CompactTextString(m) } 419func (*OtherReplyExtensions) ProtoMessage() {} 420 421func (m *OtherReplyExtensions) GetKey() int32 { 422 if m != nil && m.Key != nil { 423 return *m.Key 424 } 425 return 0 426} 427 428type OldReply struct { 429 proto.XXX_InternalExtensions `json:"-"` 430 XXX_unrecognized []byte `json:"-"` 431} 432 433func (m *OldReply) Reset() { *m = OldReply{} } 434func (m *OldReply) String() string { return proto.CompactTextString(m) } 435func (*OldReply) ProtoMessage() {} 436 437func (m *OldReply) Marshal() ([]byte, error) { 438 return proto.MarshalMessageSet(&m.XXX_InternalExtensions) 439} 440func (m *OldReply) Unmarshal(buf []byte) error { 441 return proto.UnmarshalMessageSet(buf, &m.XXX_InternalExtensions) 442} 443func (m *OldReply) MarshalJSON() ([]byte, error) { 444 return proto.MarshalMessageSetJSON(&m.XXX_InternalExtensions) 445} 446func (m *OldReply) UnmarshalJSON(buf []byte) error { 447 return proto.UnmarshalMessageSetJSON(buf, &m.XXX_InternalExtensions) 448} 449 450// ensure OldReply satisfies proto.Marshaler and proto.Unmarshaler 451var _ proto.Marshaler = (*OldReply)(nil) 452var _ proto.Unmarshaler = (*OldReply)(nil) 453 454var extRange_OldReply = []proto.ExtensionRange{ 455 {100, 2147483646}, 456} 457 458func (*OldReply) ExtensionRangeArray() []proto.ExtensionRange { 459 return extRange_OldReply 460} 461 462type Communique struct { 463 MakeMeCry *bool `protobuf:"varint,1,opt,name=make_me_cry,json=makeMeCry" json:"make_me_cry,omitempty"` 464 // This is a oneof, called "union". 465 // 466 // Types that are valid to be assigned to Union: 467 // *Communique_Number 468 // *Communique_Name 469 // *Communique_Data 470 // *Communique_TempC 471 // *Communique_Height 472 // *Communique_Today 473 // *Communique_Maybe 474 // *Communique_Delta_ 475 // *Communique_Msg 476 // *Communique_Somegroup 477 Union isCommunique_Union `protobuf_oneof:"union"` 478 XXX_unrecognized []byte `json:"-"` 479} 480 481func (m *Communique) Reset() { *m = Communique{} } 482func (m *Communique) String() string { return proto.CompactTextString(m) } 483func (*Communique) ProtoMessage() {} 484 485type isCommunique_Union interface { 486 isCommunique_Union() 487} 488 489type Communique_Number struct { 490 Number int32 `protobuf:"varint,5,opt,name=number,oneof"` 491} 492type Communique_Name struct { 493 Name string `protobuf:"bytes,6,opt,name=name,oneof"` 494} 495type Communique_Data struct { 496 Data []byte `protobuf:"bytes,7,opt,name=data,oneof"` 497} 498type Communique_TempC struct { 499 TempC float64 `protobuf:"fixed64,8,opt,name=temp_c,json=tempC,oneof"` 500} 501type Communique_Height struct { 502 Height float32 `protobuf:"fixed32,9,opt,name=height,oneof"` 503} 504type Communique_Today struct { 505 Today Days `protobuf:"varint,10,opt,name=today,enum=my.test.Days,oneof"` 506} 507type Communique_Maybe struct { 508 Maybe bool `protobuf:"varint,11,opt,name=maybe,oneof"` 509} 510type Communique_Delta_ struct { 511 Delta int32 `protobuf:"zigzag32,12,opt,name=delta,oneof"` 512} 513type Communique_Msg struct { 514 Msg *Reply `protobuf:"bytes,13,opt,name=msg,oneof"` 515} 516type Communique_Somegroup struct { 517 Somegroup *Communique_SomeGroup `protobuf:"group,14,opt,name=SomeGroup,json=somegroup,oneof"` 518} 519 520func (*Communique_Number) isCommunique_Union() {} 521func (*Communique_Name) isCommunique_Union() {} 522func (*Communique_Data) isCommunique_Union() {} 523func (*Communique_TempC) isCommunique_Union() {} 524func (*Communique_Height) isCommunique_Union() {} 525func (*Communique_Today) isCommunique_Union() {} 526func (*Communique_Maybe) isCommunique_Union() {} 527func (*Communique_Delta_) isCommunique_Union() {} 528func (*Communique_Msg) isCommunique_Union() {} 529func (*Communique_Somegroup) isCommunique_Union() {} 530 531func (m *Communique) GetUnion() isCommunique_Union { 532 if m != nil { 533 return m.Union 534 } 535 return nil 536} 537 538func (m *Communique) GetMakeMeCry() bool { 539 if m != nil && m.MakeMeCry != nil { 540 return *m.MakeMeCry 541 } 542 return false 543} 544 545func (m *Communique) GetNumber() int32 { 546 if x, ok := m.GetUnion().(*Communique_Number); ok { 547 return x.Number 548 } 549 return 0 550} 551 552func (m *Communique) GetName() string { 553 if x, ok := m.GetUnion().(*Communique_Name); ok { 554 return x.Name 555 } 556 return "" 557} 558 559func (m *Communique) GetData() []byte { 560 if x, ok := m.GetUnion().(*Communique_Data); ok { 561 return x.Data 562 } 563 return nil 564} 565 566func (m *Communique) GetTempC() float64 { 567 if x, ok := m.GetUnion().(*Communique_TempC); ok { 568 return x.TempC 569 } 570 return 0 571} 572 573func (m *Communique) GetHeight() float32 { 574 if x, ok := m.GetUnion().(*Communique_Height); ok { 575 return x.Height 576 } 577 return 0 578} 579 580func (m *Communique) GetToday() Days { 581 if x, ok := m.GetUnion().(*Communique_Today); ok { 582 return x.Today 583 } 584 return Days_MONDAY 585} 586 587func (m *Communique) GetMaybe() bool { 588 if x, ok := m.GetUnion().(*Communique_Maybe); ok { 589 return x.Maybe 590 } 591 return false 592} 593 594func (m *Communique) GetDelta() int32 { 595 if x, ok := m.GetUnion().(*Communique_Delta_); ok { 596 return x.Delta 597 } 598 return 0 599} 600 601func (m *Communique) GetMsg() *Reply { 602 if x, ok := m.GetUnion().(*Communique_Msg); ok { 603 return x.Msg 604 } 605 return nil 606} 607 608func (m *Communique) GetSomegroup() *Communique_SomeGroup { 609 if x, ok := m.GetUnion().(*Communique_Somegroup); ok { 610 return x.Somegroup 611 } 612 return nil 613} 614 615// XXX_OneofFuncs is for the internal use of the proto package. 616func (*Communique) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { 617 return _Communique_OneofMarshaler, _Communique_OneofUnmarshaler, _Communique_OneofSizer, []interface{}{ 618 (*Communique_Number)(nil), 619 (*Communique_Name)(nil), 620 (*Communique_Data)(nil), 621 (*Communique_TempC)(nil), 622 (*Communique_Height)(nil), 623 (*Communique_Today)(nil), 624 (*Communique_Maybe)(nil), 625 (*Communique_Delta_)(nil), 626 (*Communique_Msg)(nil), 627 (*Communique_Somegroup)(nil), 628 } 629} 630 631func _Communique_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { 632 m := msg.(*Communique) 633 // union 634 switch x := m.Union.(type) { 635 case *Communique_Number: 636 b.EncodeVarint(5<<3 | proto.WireVarint) 637 b.EncodeVarint(uint64(x.Number)) 638 case *Communique_Name: 639 b.EncodeVarint(6<<3 | proto.WireBytes) 640 b.EncodeStringBytes(x.Name) 641 case *Communique_Data: 642 b.EncodeVarint(7<<3 | proto.WireBytes) 643 b.EncodeRawBytes(x.Data) 644 case *Communique_TempC: 645 b.EncodeVarint(8<<3 | proto.WireFixed64) 646 b.EncodeFixed64(math.Float64bits(x.TempC)) 647 case *Communique_Height: 648 b.EncodeVarint(9<<3 | proto.WireFixed32) 649 b.EncodeFixed32(uint64(math.Float32bits(x.Height))) 650 case *Communique_Today: 651 b.EncodeVarint(10<<3 | proto.WireVarint) 652 b.EncodeVarint(uint64(x.Today)) 653 case *Communique_Maybe: 654 t := uint64(0) 655 if x.Maybe { 656 t = 1 657 } 658 b.EncodeVarint(11<<3 | proto.WireVarint) 659 b.EncodeVarint(t) 660 case *Communique_Delta_: 661 b.EncodeVarint(12<<3 | proto.WireVarint) 662 b.EncodeZigzag32(uint64(x.Delta)) 663 case *Communique_Msg: 664 b.EncodeVarint(13<<3 | proto.WireBytes) 665 if err := b.EncodeMessage(x.Msg); err != nil { 666 return err 667 } 668 case *Communique_Somegroup: 669 b.EncodeVarint(14<<3 | proto.WireStartGroup) 670 if err := b.Marshal(x.Somegroup); err != nil { 671 return err 672 } 673 b.EncodeVarint(14<<3 | proto.WireEndGroup) 674 case nil: 675 default: 676 return fmt.Errorf("Communique.Union has unexpected type %T", x) 677 } 678 return nil 679} 680 681func _Communique_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { 682 m := msg.(*Communique) 683 switch tag { 684 case 5: // union.number 685 if wire != proto.WireVarint { 686 return true, proto.ErrInternalBadWireType 687 } 688 x, err := b.DecodeVarint() 689 m.Union = &Communique_Number{int32(x)} 690 return true, err 691 case 6: // union.name 692 if wire != proto.WireBytes { 693 return true, proto.ErrInternalBadWireType 694 } 695 x, err := b.DecodeStringBytes() 696 m.Union = &Communique_Name{x} 697 return true, err 698 case 7: // union.data 699 if wire != proto.WireBytes { 700 return true, proto.ErrInternalBadWireType 701 } 702 x, err := b.DecodeRawBytes(true) 703 m.Union = &Communique_Data{x} 704 return true, err 705 case 8: // union.temp_c 706 if wire != proto.WireFixed64 { 707 return true, proto.ErrInternalBadWireType 708 } 709 x, err := b.DecodeFixed64() 710 m.Union = &Communique_TempC{math.Float64frombits(x)} 711 return true, err 712 case 9: // union.height 713 if wire != proto.WireFixed32 { 714 return true, proto.ErrInternalBadWireType 715 } 716 x, err := b.DecodeFixed32() 717 m.Union = &Communique_Height{math.Float32frombits(uint32(x))} 718 return true, err 719 case 10: // union.today 720 if wire != proto.WireVarint { 721 return true, proto.ErrInternalBadWireType 722 } 723 x, err := b.DecodeVarint() 724 m.Union = &Communique_Today{Days(x)} 725 return true, err 726 case 11: // union.maybe 727 if wire != proto.WireVarint { 728 return true, proto.ErrInternalBadWireType 729 } 730 x, err := b.DecodeVarint() 731 m.Union = &Communique_Maybe{x != 0} 732 return true, err 733 case 12: // union.delta 734 if wire != proto.WireVarint { 735 return true, proto.ErrInternalBadWireType 736 } 737 x, err := b.DecodeZigzag32() 738 m.Union = &Communique_Delta_{int32(x)} 739 return true, err 740 case 13: // union.msg 741 if wire != proto.WireBytes { 742 return true, proto.ErrInternalBadWireType 743 } 744 msg := new(Reply) 745 err := b.DecodeMessage(msg) 746 m.Union = &Communique_Msg{msg} 747 return true, err 748 case 14: // union.somegroup 749 if wire != proto.WireStartGroup { 750 return true, proto.ErrInternalBadWireType 751 } 752 msg := new(Communique_SomeGroup) 753 err := b.DecodeGroup(msg) 754 m.Union = &Communique_Somegroup{msg} 755 return true, err 756 default: 757 return false, nil 758 } 759} 760 761func _Communique_OneofSizer(msg proto.Message) (n int) { 762 m := msg.(*Communique) 763 // union 764 switch x := m.Union.(type) { 765 case *Communique_Number: 766 n += proto.SizeVarint(5<<3 | proto.WireVarint) 767 n += proto.SizeVarint(uint64(x.Number)) 768 case *Communique_Name: 769 n += proto.SizeVarint(6<<3 | proto.WireBytes) 770 n += proto.SizeVarint(uint64(len(x.Name))) 771 n += len(x.Name) 772 case *Communique_Data: 773 n += proto.SizeVarint(7<<3 | proto.WireBytes) 774 n += proto.SizeVarint(uint64(len(x.Data))) 775 n += len(x.Data) 776 case *Communique_TempC: 777 n += proto.SizeVarint(8<<3 | proto.WireFixed64) 778 n += 8 779 case *Communique_Height: 780 n += proto.SizeVarint(9<<3 | proto.WireFixed32) 781 n += 4 782 case *Communique_Today: 783 n += proto.SizeVarint(10<<3 | proto.WireVarint) 784 n += proto.SizeVarint(uint64(x.Today)) 785 case *Communique_Maybe: 786 n += proto.SizeVarint(11<<3 | proto.WireVarint) 787 n += 1 788 case *Communique_Delta_: 789 n += proto.SizeVarint(12<<3 | proto.WireVarint) 790 n += proto.SizeVarint(uint64((uint32(x.Delta) << 1) ^ uint32((int32(x.Delta) >> 31)))) 791 case *Communique_Msg: 792 s := proto.Size(x.Msg) 793 n += proto.SizeVarint(13<<3 | proto.WireBytes) 794 n += proto.SizeVarint(uint64(s)) 795 n += s 796 case *Communique_Somegroup: 797 n += proto.SizeVarint(14<<3 | proto.WireStartGroup) 798 n += proto.Size(x.Somegroup) 799 n += proto.SizeVarint(14<<3 | proto.WireEndGroup) 800 case nil: 801 default: 802 panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) 803 } 804 return n 805} 806 807type Communique_SomeGroup struct { 808 Member *string `protobuf:"bytes,15,opt,name=member" json:"member,omitempty"` 809 XXX_unrecognized []byte `json:"-"` 810} 811 812func (m *Communique_SomeGroup) Reset() { *m = Communique_SomeGroup{} } 813func (m *Communique_SomeGroup) String() string { return proto.CompactTextString(m) } 814func (*Communique_SomeGroup) ProtoMessage() {} 815 816func (m *Communique_SomeGroup) GetMember() string { 817 if m != nil && m.Member != nil { 818 return *m.Member 819 } 820 return "" 821} 822 823type Communique_Delta struct { 824 XXX_unrecognized []byte `json:"-"` 825} 826 827func (m *Communique_Delta) Reset() { *m = Communique_Delta{} } 828func (m *Communique_Delta) String() string { return proto.CompactTextString(m) } 829func (*Communique_Delta) ProtoMessage() {} 830 831var E_Tag = &proto.ExtensionDesc{ 832 ExtendedType: (*Reply)(nil), 833 ExtensionType: (*string)(nil), 834 Field: 103, 835 Name: "my.test.tag", 836 Tag: "bytes,103,opt,name=tag", 837 Filename: "my_test/test.proto", 838} 839 840var E_Donut = &proto.ExtensionDesc{ 841 ExtendedType: (*Reply)(nil), 842 ExtensionType: (*OtherReplyExtensions)(nil), 843 Field: 106, 844 Name: "my.test.donut", 845 Tag: "bytes,106,opt,name=donut", 846 Filename: "my_test/test.proto", 847} 848 849func init() { 850 proto.RegisterType((*Request)(nil), "my.test.Request") 851 proto.RegisterType((*Request_SomeGroup)(nil), "my.test.Request.SomeGroup") 852 proto.RegisterType((*Reply)(nil), "my.test.Reply") 853 proto.RegisterType((*Reply_Entry)(nil), "my.test.Reply.Entry") 854 proto.RegisterType((*OtherBase)(nil), "my.test.OtherBase") 855 proto.RegisterType((*ReplyExtensions)(nil), "my.test.ReplyExtensions") 856 proto.RegisterType((*OtherReplyExtensions)(nil), "my.test.OtherReplyExtensions") 857 proto.RegisterType((*OldReply)(nil), "my.test.OldReply") 858 proto.RegisterType((*Communique)(nil), "my.test.Communique") 859 proto.RegisterType((*Communique_SomeGroup)(nil), "my.test.Communique.SomeGroup") 860 proto.RegisterType((*Communique_Delta)(nil), "my.test.Communique.Delta") 861 proto.RegisterEnum("my.test.HatType", HatType_name, HatType_value) 862 proto.RegisterEnum("my.test.Days", Days_name, Days_value) 863 proto.RegisterEnum("my.test.Request_Color", Request_Color_name, Request_Color_value) 864 proto.RegisterEnum("my.test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value) 865 proto.RegisterExtension(E_ReplyExtensions_Time) 866 proto.RegisterExtension(E_ReplyExtensions_Carrot) 867 proto.RegisterExtension(E_ReplyExtensions_Donut) 868 proto.RegisterExtension(E_Tag) 869 proto.RegisterExtension(E_Donut) 870} 871