test.pb.go 24 KB

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