test.pb.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  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. It is generated from these files:
  7. my_test/test.proto
  8. It has these top-level messages:
  9. Request
  10. Reply
  11. OtherBase
  12. ReplyExtensions
  13. OtherReplyExtensions
  14. OldReply
  15. */
  16. package my_test
  17. import proto "github.com/golang/protobuf/proto"
  18. import math "math"
  19. // discarding unused import multi2 "multi/multi1.pb"
  20. // Reference imports to suppress errors if they are not otherwise used.
  21. var _ = proto.Marshal
  22. var _ = math.Inf
  23. type HatType int32
  24. const (
  25. // deliberately skipping 0
  26. HatType_FEDORA HatType = 1
  27. HatType_FEZ HatType = 2
  28. )
  29. var HatType_name = map[int32]string{
  30. 1: "FEDORA",
  31. 2: "FEZ",
  32. }
  33. var HatType_value = map[string]int32{
  34. "FEDORA": 1,
  35. "FEZ": 2,
  36. }
  37. func (x HatType) Enum() *HatType {
  38. p := new(HatType)
  39. *p = x
  40. return p
  41. }
  42. func (x HatType) String() string {
  43. return proto.EnumName(HatType_name, int32(x))
  44. }
  45. func (x *HatType) UnmarshalJSON(data []byte) error {
  46. value, err := proto.UnmarshalJSONEnum(HatType_value, data, "HatType")
  47. if err != nil {
  48. return err
  49. }
  50. *x = HatType(value)
  51. return nil
  52. }
  53. // This enum represents days of the week.
  54. type Days int32
  55. const (
  56. Days_MONDAY Days = 1
  57. Days_TUESDAY Days = 2
  58. Days_LUNDI Days = 1
  59. )
  60. var Days_name = map[int32]string{
  61. 1: "MONDAY",
  62. 2: "TUESDAY",
  63. // Duplicate value: 1: "LUNDI",
  64. }
  65. var Days_value = map[string]int32{
  66. "MONDAY": 1,
  67. "TUESDAY": 2,
  68. "LUNDI": 1,
  69. }
  70. func (x Days) Enum() *Days {
  71. p := new(Days)
  72. *p = x
  73. return p
  74. }
  75. func (x Days) String() string {
  76. return proto.EnumName(Days_name, int32(x))
  77. }
  78. func (x *Days) UnmarshalJSON(data []byte) error {
  79. value, err := proto.UnmarshalJSONEnum(Days_value, data, "Days")
  80. if err != nil {
  81. return err
  82. }
  83. *x = Days(value)
  84. return nil
  85. }
  86. type Request_Color int32
  87. const (
  88. Request_RED Request_Color = 0
  89. Request_GREEN Request_Color = 1
  90. Request_BLUE Request_Color = 2
  91. )
  92. var Request_Color_name = map[int32]string{
  93. 0: "RED",
  94. 1: "GREEN",
  95. 2: "BLUE",
  96. }
  97. var Request_Color_value = map[string]int32{
  98. "RED": 0,
  99. "GREEN": 1,
  100. "BLUE": 2,
  101. }
  102. func (x Request_Color) Enum() *Request_Color {
  103. p := new(Request_Color)
  104. *p = x
  105. return p
  106. }
  107. func (x Request_Color) String() string {
  108. return proto.EnumName(Request_Color_name, int32(x))
  109. }
  110. func (x *Request_Color) UnmarshalJSON(data []byte) error {
  111. value, err := proto.UnmarshalJSONEnum(Request_Color_value, data, "Request_Color")
  112. if err != nil {
  113. return err
  114. }
  115. *x = Request_Color(value)
  116. return nil
  117. }
  118. type Reply_Entry_Game int32
  119. const (
  120. Reply_Entry_FOOTBALL Reply_Entry_Game = 1
  121. Reply_Entry_TENNIS Reply_Entry_Game = 2
  122. )
  123. var Reply_Entry_Game_name = map[int32]string{
  124. 1: "FOOTBALL",
  125. 2: "TENNIS",
  126. }
  127. var Reply_Entry_Game_value = map[string]int32{
  128. "FOOTBALL": 1,
  129. "TENNIS": 2,
  130. }
  131. func (x Reply_Entry_Game) Enum() *Reply_Entry_Game {
  132. p := new(Reply_Entry_Game)
  133. *p = x
  134. return p
  135. }
  136. func (x Reply_Entry_Game) String() string {
  137. return proto.EnumName(Reply_Entry_Game_name, int32(x))
  138. }
  139. func (x *Reply_Entry_Game) UnmarshalJSON(data []byte) error {
  140. value, err := proto.UnmarshalJSONEnum(Reply_Entry_Game_value, data, "Reply_Entry_Game")
  141. if err != nil {
  142. return err
  143. }
  144. *x = Reply_Entry_Game(value)
  145. return nil
  146. }
  147. // This is a message that might be sent somewhere.
  148. type Request struct {
  149. Key []int64 `protobuf:"varint,1,rep,name=key" json:"key,omitempty"`
  150. // optional imp.ImportedMessage imported_message = 2;
  151. Hue *Request_Color `protobuf:"varint,3,opt,name=hue,enum=my.test.Request_Color" json:"hue,omitempty"`
  152. Hat *HatType `protobuf:"varint,4,opt,name=hat,enum=my.test.HatType,def=1" json:"hat,omitempty"`
  153. // optional imp.ImportedMessage.Owner owner = 6;
  154. Deadline *float32 `protobuf:"fixed32,7,opt,name=deadline,def=inf" json:"deadline,omitempty"`
  155. Somegroup *Request_SomeGroup `protobuf:"group,8,opt,name=SomeGroup" json:"somegroup,omitempty"`
  156. // This is a map field. It will generate map[int32]string.
  157. NameMapping map[int32]string `protobuf:"bytes,14,rep,name=name_mapping" json:"name_mapping,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
  158. // This is a map field whose value type is a message.
  159. MsgMapping map[int64]*Reply `protobuf:"bytes,15,rep,name=msg_mapping" json:"msg_mapping,omitempty" protobuf_key:"zigzag64,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
  160. Reset_ *int32 `protobuf:"varint,12,opt,name=reset" json:"reset,omitempty"`
  161. XXX_unrecognized []byte `json:"-"`
  162. }
  163. func (m *Request) Reset() { *m = Request{} }
  164. func (m *Request) String() string { return proto.CompactTextString(m) }
  165. func (*Request) ProtoMessage() {}
  166. const Default_Request_Hat HatType = HatType_FEDORA
  167. var Default_Request_Deadline float32 = float32(math.Inf(1))
  168. func (m *Request) GetKey() []int64 {
  169. if m != nil {
  170. return m.Key
  171. }
  172. return nil
  173. }
  174. func (m *Request) GetHue() Request_Color {
  175. if m != nil && m.Hue != nil {
  176. return *m.Hue
  177. }
  178. return Request_RED
  179. }
  180. func (m *Request) GetHat() HatType {
  181. if m != nil && m.Hat != nil {
  182. return *m.Hat
  183. }
  184. return Default_Request_Hat
  185. }
  186. func (m *Request) GetDeadline() float32 {
  187. if m != nil && m.Deadline != nil {
  188. return *m.Deadline
  189. }
  190. return Default_Request_Deadline
  191. }
  192. func (m *Request) GetSomegroup() *Request_SomeGroup {
  193. if m != nil {
  194. return m.Somegroup
  195. }
  196. return nil
  197. }
  198. func (m *Request) GetNameMapping() map[int32]string {
  199. if m != nil {
  200. return m.NameMapping
  201. }
  202. return nil
  203. }
  204. func (m *Request) GetMsgMapping() map[int64]*Reply {
  205. if m != nil {
  206. return m.MsgMapping
  207. }
  208. return nil
  209. }
  210. func (m *Request) GetReset_() int32 {
  211. if m != nil && m.Reset_ != nil {
  212. return *m.Reset_
  213. }
  214. return 0
  215. }
  216. type Request_SomeGroup struct {
  217. GroupField *int32 `protobuf:"varint,9,opt,name=group_field" json:"group_field,omitempty"`
  218. XXX_unrecognized []byte `json:"-"`
  219. }
  220. func (m *Request_SomeGroup) Reset() { *m = Request_SomeGroup{} }
  221. func (m *Request_SomeGroup) String() string { return proto.CompactTextString(m) }
  222. func (*Request_SomeGroup) ProtoMessage() {}
  223. func (m *Request_SomeGroup) GetGroupField() int32 {
  224. if m != nil && m.GroupField != nil {
  225. return *m.GroupField
  226. }
  227. return 0
  228. }
  229. type Reply struct {
  230. Found []*Reply_Entry `protobuf:"bytes,1,rep,name=found" json:"found,omitempty"`
  231. CompactKeys []int32 `protobuf:"varint,2,rep,packed,name=compact_keys" json:"compact_keys,omitempty"`
  232. XXX_extensions map[int32]proto.Extension `json:"-"`
  233. XXX_unrecognized []byte `json:"-"`
  234. }
  235. func (m *Reply) Reset() { *m = Reply{} }
  236. func (m *Reply) String() string { return proto.CompactTextString(m) }
  237. func (*Reply) ProtoMessage() {}
  238. var extRange_Reply = []proto.ExtensionRange{
  239. {100, 536870911},
  240. }
  241. func (*Reply) ExtensionRangeArray() []proto.ExtensionRange {
  242. return extRange_Reply
  243. }
  244. func (m *Reply) ExtensionMap() map[int32]proto.Extension {
  245. if m.XXX_extensions == nil {
  246. m.XXX_extensions = make(map[int32]proto.Extension)
  247. }
  248. return m.XXX_extensions
  249. }
  250. func (m *Reply) GetFound() []*Reply_Entry {
  251. if m != nil {
  252. return m.Found
  253. }
  254. return nil
  255. }
  256. func (m *Reply) GetCompactKeys() []int32 {
  257. if m != nil {
  258. return m.CompactKeys
  259. }
  260. return nil
  261. }
  262. type Reply_Entry struct {
  263. KeyThatNeeds_1234Camel_CasIng *int64 `protobuf:"varint,1,req,name=key_that_needs_1234camel_CasIng" json:"key_that_needs_1234camel_CasIng,omitempty"`
  264. Value *int64 `protobuf:"varint,2,opt,name=value,def=7" json:"value,omitempty"`
  265. XMyFieldName_2 *int64 `protobuf:"varint,3,opt,name=_my_field_name_2" json:"_my_field_name_2,omitempty"`
  266. XXX_unrecognized []byte `json:"-"`
  267. }
  268. func (m *Reply_Entry) Reset() { *m = Reply_Entry{} }
  269. func (m *Reply_Entry) String() string { return proto.CompactTextString(m) }
  270. func (*Reply_Entry) ProtoMessage() {}
  271. const Default_Reply_Entry_Value int64 = 7
  272. func (m *Reply_Entry) GetKeyThatNeeds_1234Camel_CasIng() int64 {
  273. if m != nil && m.KeyThatNeeds_1234Camel_CasIng != nil {
  274. return *m.KeyThatNeeds_1234Camel_CasIng
  275. }
  276. return 0
  277. }
  278. func (m *Reply_Entry) GetValue() int64 {
  279. if m != nil && m.Value != nil {
  280. return *m.Value
  281. }
  282. return Default_Reply_Entry_Value
  283. }
  284. func (m *Reply_Entry) GetXMyFieldName_2() int64 {
  285. if m != nil && m.XMyFieldName_2 != nil {
  286. return *m.XMyFieldName_2
  287. }
  288. return 0
  289. }
  290. type OtherBase struct {
  291. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
  292. XXX_extensions map[int32]proto.Extension `json:"-"`
  293. XXX_unrecognized []byte `json:"-"`
  294. }
  295. func (m *OtherBase) Reset() { *m = OtherBase{} }
  296. func (m *OtherBase) String() string { return proto.CompactTextString(m) }
  297. func (*OtherBase) ProtoMessage() {}
  298. var extRange_OtherBase = []proto.ExtensionRange{
  299. {100, 536870911},
  300. }
  301. func (*OtherBase) ExtensionRangeArray() []proto.ExtensionRange {
  302. return extRange_OtherBase
  303. }
  304. func (m *OtherBase) ExtensionMap() map[int32]proto.Extension {
  305. if m.XXX_extensions == nil {
  306. m.XXX_extensions = make(map[int32]proto.Extension)
  307. }
  308. return m.XXX_extensions
  309. }
  310. func (m *OtherBase) GetName() string {
  311. if m != nil && m.Name != nil {
  312. return *m.Name
  313. }
  314. return ""
  315. }
  316. type ReplyExtensions struct {
  317. XXX_unrecognized []byte `json:"-"`
  318. }
  319. func (m *ReplyExtensions) Reset() { *m = ReplyExtensions{} }
  320. func (m *ReplyExtensions) String() string { return proto.CompactTextString(m) }
  321. func (*ReplyExtensions) ProtoMessage() {}
  322. var E_ReplyExtensions_Time = &proto.ExtensionDesc{
  323. ExtendedType: (*Reply)(nil),
  324. ExtensionType: (*float64)(nil),
  325. Field: 101,
  326. Name: "my.test.ReplyExtensions.time",
  327. Tag: "fixed64,101,opt,name=time",
  328. }
  329. var E_ReplyExtensions_Carrot = &proto.ExtensionDesc{
  330. ExtendedType: (*Reply)(nil),
  331. ExtensionType: (*ReplyExtensions)(nil),
  332. Field: 105,
  333. Name: "my.test.ReplyExtensions.carrot",
  334. Tag: "bytes,105,opt,name=carrot",
  335. }
  336. var E_ReplyExtensions_Donut = &proto.ExtensionDesc{
  337. ExtendedType: (*OtherBase)(nil),
  338. ExtensionType: (*ReplyExtensions)(nil),
  339. Field: 101,
  340. Name: "my.test.ReplyExtensions.donut",
  341. Tag: "bytes,101,opt,name=donut",
  342. }
  343. type OtherReplyExtensions struct {
  344. Key *int32 `protobuf:"varint,1,opt,name=key" json:"key,omitempty"`
  345. XXX_unrecognized []byte `json:"-"`
  346. }
  347. func (m *OtherReplyExtensions) Reset() { *m = OtherReplyExtensions{} }
  348. func (m *OtherReplyExtensions) String() string { return proto.CompactTextString(m) }
  349. func (*OtherReplyExtensions) ProtoMessage() {}
  350. func (m *OtherReplyExtensions) GetKey() int32 {
  351. if m != nil && m.Key != nil {
  352. return *m.Key
  353. }
  354. return 0
  355. }
  356. type OldReply struct {
  357. XXX_extensions map[int32]proto.Extension `json:"-"`
  358. XXX_unrecognized []byte `json:"-"`
  359. }
  360. func (m *OldReply) Reset() { *m = OldReply{} }
  361. func (m *OldReply) String() string { return proto.CompactTextString(m) }
  362. func (*OldReply) ProtoMessage() {}
  363. func (m *OldReply) Marshal() ([]byte, error) {
  364. return proto.MarshalMessageSet(m.ExtensionMap())
  365. }
  366. func (m *OldReply) Unmarshal(buf []byte) error {
  367. return proto.UnmarshalMessageSet(buf, m.ExtensionMap())
  368. }
  369. func (m *OldReply) MarshalJSON() ([]byte, error) {
  370. return proto.MarshalMessageSetJSON(m.XXX_extensions)
  371. }
  372. func (m *OldReply) UnmarshalJSON(buf []byte) error {
  373. return proto.UnmarshalMessageSetJSON(buf, m.XXX_extensions)
  374. }
  375. // ensure OldReply satisfies proto.Marshaler and proto.Unmarshaler
  376. var _ proto.Marshaler = (*OldReply)(nil)
  377. var _ proto.Unmarshaler = (*OldReply)(nil)
  378. var extRange_OldReply = []proto.ExtensionRange{
  379. {100, 2147483646},
  380. }
  381. func (*OldReply) ExtensionRangeArray() []proto.ExtensionRange {
  382. return extRange_OldReply
  383. }
  384. func (m *OldReply) ExtensionMap() map[int32]proto.Extension {
  385. if m.XXX_extensions == nil {
  386. m.XXX_extensions = make(map[int32]proto.Extension)
  387. }
  388. return m.XXX_extensions
  389. }
  390. var E_Tag = &proto.ExtensionDesc{
  391. ExtendedType: (*Reply)(nil),
  392. ExtensionType: (*string)(nil),
  393. Field: 103,
  394. Name: "my.test.tag",
  395. Tag: "bytes,103,opt,name=tag",
  396. }
  397. var E_Donut = &proto.ExtensionDesc{
  398. ExtendedType: (*Reply)(nil),
  399. ExtensionType: (*OtherReplyExtensions)(nil),
  400. Field: 106,
  401. Name: "my.test.donut",
  402. Tag: "bytes,106,opt,name=donut",
  403. }
  404. func init() {
  405. proto.RegisterEnum("my.test.HatType", HatType_name, HatType_value)
  406. proto.RegisterEnum("my.test.Days", Days_name, Days_value)
  407. proto.RegisterEnum("my.test.Request_Color", Request_Color_name, Request_Color_value)
  408. proto.RegisterEnum("my.test.Reply_Entry_Game", Reply_Entry_Game_name, Reply_Entry_Game_value)
  409. proto.RegisterExtension(E_ReplyExtensions_Time)
  410. proto.RegisterExtension(E_ReplyExtensions_Carrot)
  411. proto.RegisterExtension(E_ReplyExtensions_Donut)
  412. proto.RegisterExtension(E_Tag)
  413. proto.RegisterExtension(E_Donut)
  414. }