enumdecl.pb.go 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: enumdecl.proto
  3. /*
  4. Package enumdecl is a generated protocol buffer package.
  5. It is generated from these files:
  6. enumdecl.proto
  7. It has these top-level messages:
  8. Message
  9. */
  10. package enumdecl
  11. import proto "github.com/gogo/protobuf/proto"
  12. import fmt "fmt"
  13. import math "math"
  14. import _ "github.com/gogo/protobuf/gogoproto"
  15. import io "io"
  16. // Reference imports to suppress errors if they are not otherwise used.
  17. var _ = proto.Marshal
  18. var _ = fmt.Errorf
  19. var _ = math.Inf
  20. // This is a compile-time assertion to ensure that this generated file
  21. // is compatible with the proto package it is being compiled against.
  22. // A compilation error at this line likely means your copy of the
  23. // proto package needs to be updated.
  24. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
  25. var MyEnum_name = map[int32]string{
  26. 0: "A",
  27. 1: "B",
  28. }
  29. var MyEnum_value = map[string]int32{
  30. "A": 0,
  31. "B": 1,
  32. }
  33. func (x MyEnum) String() string {
  34. return proto.EnumName(MyEnum_name, int32(x))
  35. }
  36. func (MyEnum) EnumDescriptor() ([]byte, []int) { return fileDescriptorEnumdecl, []int{0} }
  37. type Message struct {
  38. EnumeratedField MyEnum `protobuf:"varint,1,opt,name=enumerated_field,json=enumeratedField,proto3,enum=enumdecl.MyEnum" json:"enumerated_field,omitempty"`
  39. }
  40. func (m *Message) Reset() { *m = Message{} }
  41. func (m *Message) String() string { return proto.CompactTextString(m) }
  42. func (*Message) ProtoMessage() {}
  43. func (*Message) Descriptor() ([]byte, []int) { return fileDescriptorEnumdecl, []int{0} }
  44. func (m *Message) GetEnumeratedField() MyEnum {
  45. if m != nil {
  46. return m.EnumeratedField
  47. }
  48. return A
  49. }
  50. func init() {
  51. proto.RegisterType((*Message)(nil), "enumdecl.Message")
  52. proto.RegisterEnum("enumdecl.MyEnum", MyEnum_name, MyEnum_value)
  53. }
  54. func (this *Message) VerboseEqual(that interface{}) error {
  55. if that == nil {
  56. if this == nil {
  57. return nil
  58. }
  59. return fmt.Errorf("that == nil && this != nil")
  60. }
  61. that1, ok := that.(*Message)
  62. if !ok {
  63. that2, ok := that.(Message)
  64. if ok {
  65. that1 = &that2
  66. } else {
  67. return fmt.Errorf("that is not of type *Message")
  68. }
  69. }
  70. if that1 == nil {
  71. if this == nil {
  72. return nil
  73. }
  74. return fmt.Errorf("that is type *Message but is nil && this != nil")
  75. } else if this == nil {
  76. return fmt.Errorf("that is type *Message but is not nil && this == nil")
  77. }
  78. if this.EnumeratedField != that1.EnumeratedField {
  79. return fmt.Errorf("EnumeratedField this(%v) Not Equal that(%v)", this.EnumeratedField, that1.EnumeratedField)
  80. }
  81. return nil
  82. }
  83. func (this *Message) Equal(that interface{}) bool {
  84. if that == nil {
  85. if this == nil {
  86. return true
  87. }
  88. return false
  89. }
  90. that1, ok := that.(*Message)
  91. if !ok {
  92. that2, ok := that.(Message)
  93. if ok {
  94. that1 = &that2
  95. } else {
  96. return false
  97. }
  98. }
  99. if that1 == nil {
  100. if this == nil {
  101. return true
  102. }
  103. return false
  104. } else if this == nil {
  105. return false
  106. }
  107. if this.EnumeratedField != that1.EnumeratedField {
  108. return false
  109. }
  110. return true
  111. }
  112. func (m *Message) Marshal() (dAtA []byte, err error) {
  113. size := m.Size()
  114. dAtA = make([]byte, size)
  115. n, err := m.MarshalTo(dAtA)
  116. if err != nil {
  117. return nil, err
  118. }
  119. return dAtA[:n], nil
  120. }
  121. func (m *Message) MarshalTo(dAtA []byte) (int, error) {
  122. var i int
  123. _ = i
  124. var l int
  125. _ = l
  126. if m.EnumeratedField != 0 {
  127. dAtA[i] = 0x8
  128. i++
  129. i = encodeVarintEnumdecl(dAtA, i, uint64(m.EnumeratedField))
  130. }
  131. return i, nil
  132. }
  133. func encodeVarintEnumdecl(dAtA []byte, offset int, v uint64) int {
  134. for v >= 1<<7 {
  135. dAtA[offset] = uint8(v&0x7f | 0x80)
  136. v >>= 7
  137. offset++
  138. }
  139. dAtA[offset] = uint8(v)
  140. return offset + 1
  141. }
  142. func NewPopulatedMessage(r randyEnumdecl, easy bool) *Message {
  143. this := &Message{}
  144. this.EnumeratedField = MyEnum([]int32{0, 1}[r.Intn(2)])
  145. if !easy && r.Intn(10) != 0 {
  146. }
  147. return this
  148. }
  149. type randyEnumdecl interface {
  150. Float32() float32
  151. Float64() float64
  152. Int63() int64
  153. Int31() int32
  154. Uint32() uint32
  155. Intn(n int) int
  156. }
  157. func randUTF8RuneEnumdecl(r randyEnumdecl) rune {
  158. ru := r.Intn(62)
  159. if ru < 10 {
  160. return rune(ru + 48)
  161. } else if ru < 36 {
  162. return rune(ru + 55)
  163. }
  164. return rune(ru + 61)
  165. }
  166. func randStringEnumdecl(r randyEnumdecl) string {
  167. v1 := r.Intn(100)
  168. tmps := make([]rune, v1)
  169. for i := 0; i < v1; i++ {
  170. tmps[i] = randUTF8RuneEnumdecl(r)
  171. }
  172. return string(tmps)
  173. }
  174. func randUnrecognizedEnumdecl(r randyEnumdecl, maxFieldNumber int) (dAtA []byte) {
  175. l := r.Intn(5)
  176. for i := 0; i < l; i++ {
  177. wire := r.Intn(4)
  178. if wire == 3 {
  179. wire = 5
  180. }
  181. fieldNumber := maxFieldNumber + r.Intn(100)
  182. dAtA = randFieldEnumdecl(dAtA, r, fieldNumber, wire)
  183. }
  184. return dAtA
  185. }
  186. func randFieldEnumdecl(dAtA []byte, r randyEnumdecl, fieldNumber int, wire int) []byte {
  187. key := uint32(fieldNumber)<<3 | uint32(wire)
  188. switch wire {
  189. case 0:
  190. dAtA = encodeVarintPopulateEnumdecl(dAtA, uint64(key))
  191. v2 := r.Int63()
  192. if r.Intn(2) == 0 {
  193. v2 *= -1
  194. }
  195. dAtA = encodeVarintPopulateEnumdecl(dAtA, uint64(v2))
  196. case 1:
  197. dAtA = encodeVarintPopulateEnumdecl(dAtA, uint64(key))
  198. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  199. case 2:
  200. dAtA = encodeVarintPopulateEnumdecl(dAtA, uint64(key))
  201. ll := r.Intn(100)
  202. dAtA = encodeVarintPopulateEnumdecl(dAtA, uint64(ll))
  203. for j := 0; j < ll; j++ {
  204. dAtA = append(dAtA, byte(r.Intn(256)))
  205. }
  206. default:
  207. dAtA = encodeVarintPopulateEnumdecl(dAtA, uint64(key))
  208. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  209. }
  210. return dAtA
  211. }
  212. func encodeVarintPopulateEnumdecl(dAtA []byte, v uint64) []byte {
  213. for v >= 1<<7 {
  214. dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
  215. v >>= 7
  216. }
  217. dAtA = append(dAtA, uint8(v))
  218. return dAtA
  219. }
  220. func (m *Message) Size() (n int) {
  221. var l int
  222. _ = l
  223. if m.EnumeratedField != 0 {
  224. n += 1 + sovEnumdecl(uint64(m.EnumeratedField))
  225. }
  226. return n
  227. }
  228. func sovEnumdecl(x uint64) (n int) {
  229. for {
  230. n++
  231. x >>= 7
  232. if x == 0 {
  233. break
  234. }
  235. }
  236. return n
  237. }
  238. func sozEnumdecl(x uint64) (n int) {
  239. return sovEnumdecl(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  240. }
  241. func (m *Message) Unmarshal(dAtA []byte) error {
  242. l := len(dAtA)
  243. iNdEx := 0
  244. for iNdEx < l {
  245. preIndex := iNdEx
  246. var wire uint64
  247. for shift := uint(0); ; shift += 7 {
  248. if shift >= 64 {
  249. return ErrIntOverflowEnumdecl
  250. }
  251. if iNdEx >= l {
  252. return io.ErrUnexpectedEOF
  253. }
  254. b := dAtA[iNdEx]
  255. iNdEx++
  256. wire |= (uint64(b) & 0x7F) << shift
  257. if b < 0x80 {
  258. break
  259. }
  260. }
  261. fieldNum := int32(wire >> 3)
  262. wireType := int(wire & 0x7)
  263. if wireType == 4 {
  264. return fmt.Errorf("proto: Message: wiretype end group for non-group")
  265. }
  266. if fieldNum <= 0 {
  267. return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
  268. }
  269. switch fieldNum {
  270. case 1:
  271. if wireType != 0 {
  272. return fmt.Errorf("proto: wrong wireType = %d for field EnumeratedField", wireType)
  273. }
  274. m.EnumeratedField = 0
  275. for shift := uint(0); ; shift += 7 {
  276. if shift >= 64 {
  277. return ErrIntOverflowEnumdecl
  278. }
  279. if iNdEx >= l {
  280. return io.ErrUnexpectedEOF
  281. }
  282. b := dAtA[iNdEx]
  283. iNdEx++
  284. m.EnumeratedField |= (MyEnum(b) & 0x7F) << shift
  285. if b < 0x80 {
  286. break
  287. }
  288. }
  289. default:
  290. iNdEx = preIndex
  291. skippy, err := skipEnumdecl(dAtA[iNdEx:])
  292. if err != nil {
  293. return err
  294. }
  295. if skippy < 0 {
  296. return ErrInvalidLengthEnumdecl
  297. }
  298. if (iNdEx + skippy) > l {
  299. return io.ErrUnexpectedEOF
  300. }
  301. iNdEx += skippy
  302. }
  303. }
  304. if iNdEx > l {
  305. return io.ErrUnexpectedEOF
  306. }
  307. return nil
  308. }
  309. func skipEnumdecl(dAtA []byte) (n int, err error) {
  310. l := len(dAtA)
  311. iNdEx := 0
  312. for iNdEx < l {
  313. var wire uint64
  314. for shift := uint(0); ; shift += 7 {
  315. if shift >= 64 {
  316. return 0, ErrIntOverflowEnumdecl
  317. }
  318. if iNdEx >= l {
  319. return 0, io.ErrUnexpectedEOF
  320. }
  321. b := dAtA[iNdEx]
  322. iNdEx++
  323. wire |= (uint64(b) & 0x7F) << shift
  324. if b < 0x80 {
  325. break
  326. }
  327. }
  328. wireType := int(wire & 0x7)
  329. switch wireType {
  330. case 0:
  331. for shift := uint(0); ; shift += 7 {
  332. if shift >= 64 {
  333. return 0, ErrIntOverflowEnumdecl
  334. }
  335. if iNdEx >= l {
  336. return 0, io.ErrUnexpectedEOF
  337. }
  338. iNdEx++
  339. if dAtA[iNdEx-1] < 0x80 {
  340. break
  341. }
  342. }
  343. return iNdEx, nil
  344. case 1:
  345. iNdEx += 8
  346. return iNdEx, nil
  347. case 2:
  348. var length int
  349. for shift := uint(0); ; shift += 7 {
  350. if shift >= 64 {
  351. return 0, ErrIntOverflowEnumdecl
  352. }
  353. if iNdEx >= l {
  354. return 0, io.ErrUnexpectedEOF
  355. }
  356. b := dAtA[iNdEx]
  357. iNdEx++
  358. length |= (int(b) & 0x7F) << shift
  359. if b < 0x80 {
  360. break
  361. }
  362. }
  363. iNdEx += length
  364. if length < 0 {
  365. return 0, ErrInvalidLengthEnumdecl
  366. }
  367. return iNdEx, nil
  368. case 3:
  369. for {
  370. var innerWire uint64
  371. var start int = iNdEx
  372. for shift := uint(0); ; shift += 7 {
  373. if shift >= 64 {
  374. return 0, ErrIntOverflowEnumdecl
  375. }
  376. if iNdEx >= l {
  377. return 0, io.ErrUnexpectedEOF
  378. }
  379. b := dAtA[iNdEx]
  380. iNdEx++
  381. innerWire |= (uint64(b) & 0x7F) << shift
  382. if b < 0x80 {
  383. break
  384. }
  385. }
  386. innerWireType := int(innerWire & 0x7)
  387. if innerWireType == 4 {
  388. break
  389. }
  390. next, err := skipEnumdecl(dAtA[start:])
  391. if err != nil {
  392. return 0, err
  393. }
  394. iNdEx = start + next
  395. }
  396. return iNdEx, nil
  397. case 4:
  398. return iNdEx, nil
  399. case 5:
  400. iNdEx += 4
  401. return iNdEx, nil
  402. default:
  403. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  404. }
  405. }
  406. panic("unreachable")
  407. }
  408. var (
  409. ErrInvalidLengthEnumdecl = fmt.Errorf("proto: negative length found during unmarshaling")
  410. ErrIntOverflowEnumdecl = fmt.Errorf("proto: integer overflow")
  411. )
  412. func init() { proto.RegisterFile("enumdecl.proto", fileDescriptorEnumdecl) }
  413. var fileDescriptorEnumdecl = []byte{
  414. // 205 bytes of a gzipped FileDescriptorProto
  415. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4b, 0xcd, 0x2b, 0xcd,
  416. 0x4d, 0x49, 0x4d, 0xce, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x80, 0xf1, 0xa5, 0x74,
  417. 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xd3, 0xf3, 0xd3, 0xf3, 0xf5,
  418. 0xc1, 0x0a, 0x92, 0x4a, 0xd3, 0xc0, 0x3c, 0x30, 0x07, 0xcc, 0x82, 0x68, 0x54, 0x72, 0xe3, 0x62,
  419. 0xf7, 0x4d, 0x2d, 0x2e, 0x4e, 0x4c, 0x4f, 0x15, 0xb2, 0xe6, 0x12, 0x00, 0x99, 0x92, 0x5a, 0x94,
  420. 0x58, 0x92, 0x9a, 0x12, 0x9f, 0x96, 0x99, 0x9a, 0x93, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x67,
  421. 0x24, 0xa0, 0x07, 0xb7, 0xce, 0xb7, 0xd2, 0x35, 0xaf, 0x34, 0x37, 0x88, 0x1f, 0xa1, 0xd2, 0x0d,
  422. 0xa4, 0x50, 0x4b, 0x81, 0x8b, 0x0d, 0x22, 0x25, 0xc4, 0xca, 0xc5, 0xe8, 0x28, 0xc0, 0x00, 0xa2,
  423. 0x9c, 0x04, 0x18, 0xa5, 0x38, 0x3a, 0x16, 0xcb, 0x31, 0x1c, 0x58, 0x22, 0xc7, 0xe0, 0xa4, 0xf1,
  424. 0xe0, 0xa1, 0x1c, 0xe3, 0x8f, 0x87, 0x72, 0x8c, 0x2b, 0x1e, 0xc9, 0x31, 0xee, 0x78, 0x24, 0xc7,
  425. 0x78, 0xe0, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24,
  426. 0xc7, 0xf8, 0xe3, 0x91, 0x1c, 0x43, 0xc3, 0x63, 0x39, 0x86, 0x24, 0x36, 0xb0, 0xd3, 0x8c, 0x01,
  427. 0x01, 0x00, 0x00, 0xff, 0xff, 0x76, 0x04, 0x55, 0xb7, 0xe5, 0x00, 0x00, 0x00,
  428. }