You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

807 lines
18 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: libs/common/types.proto
  3. package common
  4. import (
  5. bytes "bytes"
  6. fmt "fmt"
  7. _ "github.com/gogo/protobuf/gogoproto"
  8. proto "github.com/gogo/protobuf/proto"
  9. golang_proto "github.com/golang/protobuf/proto"
  10. io "io"
  11. math "math"
  12. math_bits "math/bits"
  13. )
  14. // Reference imports to suppress errors if they are not otherwise used.
  15. var _ = proto.Marshal
  16. var _ = golang_proto.Marshal
  17. var _ = fmt.Errorf
  18. var _ = math.Inf
  19. // This is a compile-time assertion to ensure that this generated file
  20. // is compatible with the proto package it is being compiled against.
  21. // A compilation error at this line likely means your copy of the
  22. // proto package needs to be updated.
  23. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
  24. // Define these here for compatibility but use tmlibs/common.KVPair.
  25. type KVPair struct {
  26. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  27. Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
  28. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  29. XXX_unrecognized []byte `json:"-"`
  30. XXX_sizecache int32 `json:"-"`
  31. }
  32. func (m *KVPair) Reset() { *m = KVPair{} }
  33. func (m *KVPair) String() string { return proto.CompactTextString(m) }
  34. func (*KVPair) ProtoMessage() {}
  35. func (*KVPair) Descriptor() ([]byte, []int) {
  36. return fileDescriptor_28b36ea5054b507d, []int{0}
  37. }
  38. func (m *KVPair) XXX_Unmarshal(b []byte) error {
  39. return m.Unmarshal(b)
  40. }
  41. func (m *KVPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  42. if deterministic {
  43. return xxx_messageInfo_KVPair.Marshal(b, m, deterministic)
  44. } else {
  45. b = b[:cap(b)]
  46. n, err := m.MarshalToSizedBuffer(b)
  47. if err != nil {
  48. return nil, err
  49. }
  50. return b[:n], nil
  51. }
  52. }
  53. func (m *KVPair) XXX_Merge(src proto.Message) {
  54. xxx_messageInfo_KVPair.Merge(m, src)
  55. }
  56. func (m *KVPair) XXX_Size() int {
  57. return m.Size()
  58. }
  59. func (m *KVPair) XXX_DiscardUnknown() {
  60. xxx_messageInfo_KVPair.DiscardUnknown(m)
  61. }
  62. var xxx_messageInfo_KVPair proto.InternalMessageInfo
  63. func (m *KVPair) GetKey() []byte {
  64. if m != nil {
  65. return m.Key
  66. }
  67. return nil
  68. }
  69. func (m *KVPair) GetValue() []byte {
  70. if m != nil {
  71. return m.Value
  72. }
  73. return nil
  74. }
  75. // Define these here for compatibility but use tmlibs/common.KI64Pair.
  76. type KI64Pair struct {
  77. Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
  78. Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
  79. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  80. XXX_unrecognized []byte `json:"-"`
  81. XXX_sizecache int32 `json:"-"`
  82. }
  83. func (m *KI64Pair) Reset() { *m = KI64Pair{} }
  84. func (m *KI64Pair) String() string { return proto.CompactTextString(m) }
  85. func (*KI64Pair) ProtoMessage() {}
  86. func (*KI64Pair) Descriptor() ([]byte, []int) {
  87. return fileDescriptor_28b36ea5054b507d, []int{1}
  88. }
  89. func (m *KI64Pair) XXX_Unmarshal(b []byte) error {
  90. return m.Unmarshal(b)
  91. }
  92. func (m *KI64Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  93. if deterministic {
  94. return xxx_messageInfo_KI64Pair.Marshal(b, m, deterministic)
  95. } else {
  96. b = b[:cap(b)]
  97. n, err := m.MarshalToSizedBuffer(b)
  98. if err != nil {
  99. return nil, err
  100. }
  101. return b[:n], nil
  102. }
  103. }
  104. func (m *KI64Pair) XXX_Merge(src proto.Message) {
  105. xxx_messageInfo_KI64Pair.Merge(m, src)
  106. }
  107. func (m *KI64Pair) XXX_Size() int {
  108. return m.Size()
  109. }
  110. func (m *KI64Pair) XXX_DiscardUnknown() {
  111. xxx_messageInfo_KI64Pair.DiscardUnknown(m)
  112. }
  113. var xxx_messageInfo_KI64Pair proto.InternalMessageInfo
  114. func (m *KI64Pair) GetKey() []byte {
  115. if m != nil {
  116. return m.Key
  117. }
  118. return nil
  119. }
  120. func (m *KI64Pair) GetValue() int64 {
  121. if m != nil {
  122. return m.Value
  123. }
  124. return 0
  125. }
  126. func init() {
  127. proto.RegisterType((*KVPair)(nil), "common.KVPair")
  128. golang_proto.RegisterType((*KVPair)(nil), "common.KVPair")
  129. proto.RegisterType((*KI64Pair)(nil), "common.KI64Pair")
  130. golang_proto.RegisterType((*KI64Pair)(nil), "common.KI64Pair")
  131. }
  132. func init() { proto.RegisterFile("libs/common/types.proto", fileDescriptor_28b36ea5054b507d) }
  133. func init() { golang_proto.RegisterFile("libs/common/types.proto", fileDescriptor_28b36ea5054b507d) }
  134. var fileDescriptor_28b36ea5054b507d = []byte{
  135. // 174 bytes of a gzipped FileDescriptorProto
  136. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xcf, 0xc9, 0x4c, 0x2a,
  137. 0xd6, 0x4f, 0xce, 0xcf, 0xcd, 0xcd, 0xcf, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28,
  138. 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x83, 0x88, 0x49, 0xe9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9,
  139. 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7, 0xa7, 0xe7, 0xeb, 0x83, 0xa5, 0x93, 0x4a, 0xd3, 0xc0, 0x3c,
  140. 0x30, 0x07, 0xcc, 0x82, 0x68, 0x53, 0x32, 0xe0, 0x62, 0xf3, 0x0e, 0x0b, 0x48, 0xcc, 0x2c, 0x12,
  141. 0x12, 0xe0, 0x62, 0xce, 0x4e, 0xad, 0x94, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x09, 0x02, 0x31, 0x85,
  142. 0x44, 0xb8, 0x58, 0xcb, 0x12, 0x73, 0x4a, 0x53, 0x25, 0x98, 0xc0, 0x62, 0x10, 0x8e, 0x92, 0x11,
  143. 0x17, 0x87, 0xb7, 0xa7, 0x99, 0x09, 0x31, 0x7a, 0x98, 0xa1, 0x7a, 0x9c, 0x64, 0x7e, 0x3c, 0x94,
  144. 0x63, 0x5c, 0xf1, 0x48, 0x8e, 0x71, 0xc7, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c,
  145. 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0xf1, 0xc0, 0x63, 0x39, 0xc6, 0x24, 0x36, 0xb0, 0x53, 0x8c,
  146. 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x39, 0xe1, 0xef, 0xdc, 0x00, 0x00, 0x00,
  147. }
  148. func (this *KVPair) Equal(that interface{}) bool {
  149. if that == nil {
  150. return this == nil
  151. }
  152. that1, ok := that.(*KVPair)
  153. if !ok {
  154. that2, ok := that.(KVPair)
  155. if ok {
  156. that1 = &that2
  157. } else {
  158. return false
  159. }
  160. }
  161. if that1 == nil {
  162. return this == nil
  163. } else if this == nil {
  164. return false
  165. }
  166. if !bytes.Equal(this.Key, that1.Key) {
  167. return false
  168. }
  169. if !bytes.Equal(this.Value, that1.Value) {
  170. return false
  171. }
  172. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  173. return false
  174. }
  175. return true
  176. }
  177. func (this *KI64Pair) Equal(that interface{}) bool {
  178. if that == nil {
  179. return this == nil
  180. }
  181. that1, ok := that.(*KI64Pair)
  182. if !ok {
  183. that2, ok := that.(KI64Pair)
  184. if ok {
  185. that1 = &that2
  186. } else {
  187. return false
  188. }
  189. }
  190. if that1 == nil {
  191. return this == nil
  192. } else if this == nil {
  193. return false
  194. }
  195. if !bytes.Equal(this.Key, that1.Key) {
  196. return false
  197. }
  198. if this.Value != that1.Value {
  199. return false
  200. }
  201. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  202. return false
  203. }
  204. return true
  205. }
  206. func (m *KVPair) Marshal() (dAtA []byte, err error) {
  207. size := m.Size()
  208. dAtA = make([]byte, size)
  209. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  210. if err != nil {
  211. return nil, err
  212. }
  213. return dAtA[:n], nil
  214. }
  215. func (m *KVPair) MarshalTo(dAtA []byte) (int, error) {
  216. size := m.Size()
  217. return m.MarshalToSizedBuffer(dAtA[:size])
  218. }
  219. func (m *KVPair) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  220. i := len(dAtA)
  221. _ = i
  222. var l int
  223. _ = l
  224. if m.XXX_unrecognized != nil {
  225. i -= len(m.XXX_unrecognized)
  226. copy(dAtA[i:], m.XXX_unrecognized)
  227. }
  228. if len(m.Value) > 0 {
  229. i -= len(m.Value)
  230. copy(dAtA[i:], m.Value)
  231. i = encodeVarintTypes(dAtA, i, uint64(len(m.Value)))
  232. i--
  233. dAtA[i] = 0x12
  234. }
  235. if len(m.Key) > 0 {
  236. i -= len(m.Key)
  237. copy(dAtA[i:], m.Key)
  238. i = encodeVarintTypes(dAtA, i, uint64(len(m.Key)))
  239. i--
  240. dAtA[i] = 0xa
  241. }
  242. return len(dAtA) - i, nil
  243. }
  244. func (m *KI64Pair) Marshal() (dAtA []byte, err error) {
  245. size := m.Size()
  246. dAtA = make([]byte, size)
  247. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  248. if err != nil {
  249. return nil, err
  250. }
  251. return dAtA[:n], nil
  252. }
  253. func (m *KI64Pair) MarshalTo(dAtA []byte) (int, error) {
  254. size := m.Size()
  255. return m.MarshalToSizedBuffer(dAtA[:size])
  256. }
  257. func (m *KI64Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  258. i := len(dAtA)
  259. _ = i
  260. var l int
  261. _ = l
  262. if m.XXX_unrecognized != nil {
  263. i -= len(m.XXX_unrecognized)
  264. copy(dAtA[i:], m.XXX_unrecognized)
  265. }
  266. if m.Value != 0 {
  267. i = encodeVarintTypes(dAtA, i, uint64(m.Value))
  268. i--
  269. dAtA[i] = 0x10
  270. }
  271. if len(m.Key) > 0 {
  272. i -= len(m.Key)
  273. copy(dAtA[i:], m.Key)
  274. i = encodeVarintTypes(dAtA, i, uint64(len(m.Key)))
  275. i--
  276. dAtA[i] = 0xa
  277. }
  278. return len(dAtA) - i, nil
  279. }
  280. func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
  281. offset -= sovTypes(v)
  282. base := offset
  283. for v >= 1<<7 {
  284. dAtA[offset] = uint8(v&0x7f | 0x80)
  285. v >>= 7
  286. offset++
  287. }
  288. dAtA[offset] = uint8(v)
  289. return base
  290. }
  291. func NewPopulatedKVPair(r randyTypes, easy bool) *KVPair {
  292. this := &KVPair{}
  293. v1 := r.Intn(100)
  294. this.Key = make([]byte, v1)
  295. for i := 0; i < v1; i++ {
  296. this.Key[i] = byte(r.Intn(256))
  297. }
  298. v2 := r.Intn(100)
  299. this.Value = make([]byte, v2)
  300. for i := 0; i < v2; i++ {
  301. this.Value[i] = byte(r.Intn(256))
  302. }
  303. if !easy && r.Intn(10) != 0 {
  304. this.XXX_unrecognized = randUnrecognizedTypes(r, 3)
  305. }
  306. return this
  307. }
  308. func NewPopulatedKI64Pair(r randyTypes, easy bool) *KI64Pair {
  309. this := &KI64Pair{}
  310. v3 := r.Intn(100)
  311. this.Key = make([]byte, v3)
  312. for i := 0; i < v3; i++ {
  313. this.Key[i] = byte(r.Intn(256))
  314. }
  315. this.Value = int64(r.Int63())
  316. if r.Intn(2) == 0 {
  317. this.Value *= -1
  318. }
  319. if !easy && r.Intn(10) != 0 {
  320. this.XXX_unrecognized = randUnrecognizedTypes(r, 3)
  321. }
  322. return this
  323. }
  324. type randyTypes interface {
  325. Float32() float32
  326. Float64() float64
  327. Int63() int64
  328. Int31() int32
  329. Uint32() uint32
  330. Intn(n int) int
  331. }
  332. func randUTF8RuneTypes(r randyTypes) rune {
  333. ru := r.Intn(62)
  334. if ru < 10 {
  335. return rune(ru + 48)
  336. } else if ru < 36 {
  337. return rune(ru + 55)
  338. }
  339. return rune(ru + 61)
  340. }
  341. func randStringTypes(r randyTypes) string {
  342. v4 := r.Intn(100)
  343. tmps := make([]rune, v4)
  344. for i := 0; i < v4; i++ {
  345. tmps[i] = randUTF8RuneTypes(r)
  346. }
  347. return string(tmps)
  348. }
  349. func randUnrecognizedTypes(r randyTypes, maxFieldNumber int) (dAtA []byte) {
  350. l := r.Intn(5)
  351. for i := 0; i < l; i++ {
  352. wire := r.Intn(4)
  353. if wire == 3 {
  354. wire = 5
  355. }
  356. fieldNumber := maxFieldNumber + r.Intn(100)
  357. dAtA = randFieldTypes(dAtA, r, fieldNumber, wire)
  358. }
  359. return dAtA
  360. }
  361. func randFieldTypes(dAtA []byte, r randyTypes, fieldNumber int, wire int) []byte {
  362. key := uint32(fieldNumber)<<3 | uint32(wire)
  363. switch wire {
  364. case 0:
  365. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  366. v5 := r.Int63()
  367. if r.Intn(2) == 0 {
  368. v5 *= -1
  369. }
  370. dAtA = encodeVarintPopulateTypes(dAtA, uint64(v5))
  371. case 1:
  372. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  373. 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)))
  374. case 2:
  375. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  376. ll := r.Intn(100)
  377. dAtA = encodeVarintPopulateTypes(dAtA, uint64(ll))
  378. for j := 0; j < ll; j++ {
  379. dAtA = append(dAtA, byte(r.Intn(256)))
  380. }
  381. default:
  382. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  383. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  384. }
  385. return dAtA
  386. }
  387. func encodeVarintPopulateTypes(dAtA []byte, v uint64) []byte {
  388. for v >= 1<<7 {
  389. dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
  390. v >>= 7
  391. }
  392. dAtA = append(dAtA, uint8(v))
  393. return dAtA
  394. }
  395. func (m *KVPair) Size() (n int) {
  396. if m == nil {
  397. return 0
  398. }
  399. var l int
  400. _ = l
  401. l = len(m.Key)
  402. if l > 0 {
  403. n += 1 + l + sovTypes(uint64(l))
  404. }
  405. l = len(m.Value)
  406. if l > 0 {
  407. n += 1 + l + sovTypes(uint64(l))
  408. }
  409. if m.XXX_unrecognized != nil {
  410. n += len(m.XXX_unrecognized)
  411. }
  412. return n
  413. }
  414. func (m *KI64Pair) Size() (n int) {
  415. if m == nil {
  416. return 0
  417. }
  418. var l int
  419. _ = l
  420. l = len(m.Key)
  421. if l > 0 {
  422. n += 1 + l + sovTypes(uint64(l))
  423. }
  424. if m.Value != 0 {
  425. n += 1 + sovTypes(uint64(m.Value))
  426. }
  427. if m.XXX_unrecognized != nil {
  428. n += len(m.XXX_unrecognized)
  429. }
  430. return n
  431. }
  432. func sovTypes(x uint64) (n int) {
  433. return (math_bits.Len64(x|1) + 6) / 7
  434. }
  435. func sozTypes(x uint64) (n int) {
  436. return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  437. }
  438. func (m *KVPair) Unmarshal(dAtA []byte) error {
  439. l := len(dAtA)
  440. iNdEx := 0
  441. for iNdEx < l {
  442. preIndex := iNdEx
  443. var wire uint64
  444. for shift := uint(0); ; shift += 7 {
  445. if shift >= 64 {
  446. return ErrIntOverflowTypes
  447. }
  448. if iNdEx >= l {
  449. return io.ErrUnexpectedEOF
  450. }
  451. b := dAtA[iNdEx]
  452. iNdEx++
  453. wire |= uint64(b&0x7F) << shift
  454. if b < 0x80 {
  455. break
  456. }
  457. }
  458. fieldNum := int32(wire >> 3)
  459. wireType := int(wire & 0x7)
  460. if wireType == 4 {
  461. return fmt.Errorf("proto: KVPair: wiretype end group for non-group")
  462. }
  463. if fieldNum <= 0 {
  464. return fmt.Errorf("proto: KVPair: illegal tag %d (wire type %d)", fieldNum, wire)
  465. }
  466. switch fieldNum {
  467. case 1:
  468. if wireType != 2 {
  469. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  470. }
  471. var byteLen int
  472. for shift := uint(0); ; shift += 7 {
  473. if shift >= 64 {
  474. return ErrIntOverflowTypes
  475. }
  476. if iNdEx >= l {
  477. return io.ErrUnexpectedEOF
  478. }
  479. b := dAtA[iNdEx]
  480. iNdEx++
  481. byteLen |= int(b&0x7F) << shift
  482. if b < 0x80 {
  483. break
  484. }
  485. }
  486. if byteLen < 0 {
  487. return ErrInvalidLengthTypes
  488. }
  489. postIndex := iNdEx + byteLen
  490. if postIndex < 0 {
  491. return ErrInvalidLengthTypes
  492. }
  493. if postIndex > l {
  494. return io.ErrUnexpectedEOF
  495. }
  496. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  497. if m.Key == nil {
  498. m.Key = []byte{}
  499. }
  500. iNdEx = postIndex
  501. case 2:
  502. if wireType != 2 {
  503. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  504. }
  505. var byteLen int
  506. for shift := uint(0); ; shift += 7 {
  507. if shift >= 64 {
  508. return ErrIntOverflowTypes
  509. }
  510. if iNdEx >= l {
  511. return io.ErrUnexpectedEOF
  512. }
  513. b := dAtA[iNdEx]
  514. iNdEx++
  515. byteLen |= int(b&0x7F) << shift
  516. if b < 0x80 {
  517. break
  518. }
  519. }
  520. if byteLen < 0 {
  521. return ErrInvalidLengthTypes
  522. }
  523. postIndex := iNdEx + byteLen
  524. if postIndex < 0 {
  525. return ErrInvalidLengthTypes
  526. }
  527. if postIndex > l {
  528. return io.ErrUnexpectedEOF
  529. }
  530. m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
  531. if m.Value == nil {
  532. m.Value = []byte{}
  533. }
  534. iNdEx = postIndex
  535. default:
  536. iNdEx = preIndex
  537. skippy, err := skipTypes(dAtA[iNdEx:])
  538. if err != nil {
  539. return err
  540. }
  541. if skippy < 0 {
  542. return ErrInvalidLengthTypes
  543. }
  544. if (iNdEx + skippy) < 0 {
  545. return ErrInvalidLengthTypes
  546. }
  547. if (iNdEx + skippy) > l {
  548. return io.ErrUnexpectedEOF
  549. }
  550. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  551. iNdEx += skippy
  552. }
  553. }
  554. if iNdEx > l {
  555. return io.ErrUnexpectedEOF
  556. }
  557. return nil
  558. }
  559. func (m *KI64Pair) Unmarshal(dAtA []byte) error {
  560. l := len(dAtA)
  561. iNdEx := 0
  562. for iNdEx < l {
  563. preIndex := iNdEx
  564. var wire uint64
  565. for shift := uint(0); ; shift += 7 {
  566. if shift >= 64 {
  567. return ErrIntOverflowTypes
  568. }
  569. if iNdEx >= l {
  570. return io.ErrUnexpectedEOF
  571. }
  572. b := dAtA[iNdEx]
  573. iNdEx++
  574. wire |= uint64(b&0x7F) << shift
  575. if b < 0x80 {
  576. break
  577. }
  578. }
  579. fieldNum := int32(wire >> 3)
  580. wireType := int(wire & 0x7)
  581. if wireType == 4 {
  582. return fmt.Errorf("proto: KI64Pair: wiretype end group for non-group")
  583. }
  584. if fieldNum <= 0 {
  585. return fmt.Errorf("proto: KI64Pair: illegal tag %d (wire type %d)", fieldNum, wire)
  586. }
  587. switch fieldNum {
  588. case 1:
  589. if wireType != 2 {
  590. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  591. }
  592. var byteLen int
  593. for shift := uint(0); ; shift += 7 {
  594. if shift >= 64 {
  595. return ErrIntOverflowTypes
  596. }
  597. if iNdEx >= l {
  598. return io.ErrUnexpectedEOF
  599. }
  600. b := dAtA[iNdEx]
  601. iNdEx++
  602. byteLen |= int(b&0x7F) << shift
  603. if b < 0x80 {
  604. break
  605. }
  606. }
  607. if byteLen < 0 {
  608. return ErrInvalidLengthTypes
  609. }
  610. postIndex := iNdEx + byteLen
  611. if postIndex < 0 {
  612. return ErrInvalidLengthTypes
  613. }
  614. if postIndex > l {
  615. return io.ErrUnexpectedEOF
  616. }
  617. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  618. if m.Key == nil {
  619. m.Key = []byte{}
  620. }
  621. iNdEx = postIndex
  622. case 2:
  623. if wireType != 0 {
  624. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  625. }
  626. m.Value = 0
  627. for shift := uint(0); ; shift += 7 {
  628. if shift >= 64 {
  629. return ErrIntOverflowTypes
  630. }
  631. if iNdEx >= l {
  632. return io.ErrUnexpectedEOF
  633. }
  634. b := dAtA[iNdEx]
  635. iNdEx++
  636. m.Value |= int64(b&0x7F) << shift
  637. if b < 0x80 {
  638. break
  639. }
  640. }
  641. default:
  642. iNdEx = preIndex
  643. skippy, err := skipTypes(dAtA[iNdEx:])
  644. if err != nil {
  645. return err
  646. }
  647. if skippy < 0 {
  648. return ErrInvalidLengthTypes
  649. }
  650. if (iNdEx + skippy) < 0 {
  651. return ErrInvalidLengthTypes
  652. }
  653. if (iNdEx + skippy) > l {
  654. return io.ErrUnexpectedEOF
  655. }
  656. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  657. iNdEx += skippy
  658. }
  659. }
  660. if iNdEx > l {
  661. return io.ErrUnexpectedEOF
  662. }
  663. return nil
  664. }
  665. func skipTypes(dAtA []byte) (n int, err error) {
  666. l := len(dAtA)
  667. iNdEx := 0
  668. for iNdEx < l {
  669. var wire uint64
  670. for shift := uint(0); ; shift += 7 {
  671. if shift >= 64 {
  672. return 0, ErrIntOverflowTypes
  673. }
  674. if iNdEx >= l {
  675. return 0, io.ErrUnexpectedEOF
  676. }
  677. b := dAtA[iNdEx]
  678. iNdEx++
  679. wire |= (uint64(b) & 0x7F) << shift
  680. if b < 0x80 {
  681. break
  682. }
  683. }
  684. wireType := int(wire & 0x7)
  685. switch wireType {
  686. case 0:
  687. for shift := uint(0); ; shift += 7 {
  688. if shift >= 64 {
  689. return 0, ErrIntOverflowTypes
  690. }
  691. if iNdEx >= l {
  692. return 0, io.ErrUnexpectedEOF
  693. }
  694. iNdEx++
  695. if dAtA[iNdEx-1] < 0x80 {
  696. break
  697. }
  698. }
  699. return iNdEx, nil
  700. case 1:
  701. iNdEx += 8
  702. return iNdEx, nil
  703. case 2:
  704. var length int
  705. for shift := uint(0); ; shift += 7 {
  706. if shift >= 64 {
  707. return 0, ErrIntOverflowTypes
  708. }
  709. if iNdEx >= l {
  710. return 0, io.ErrUnexpectedEOF
  711. }
  712. b := dAtA[iNdEx]
  713. iNdEx++
  714. length |= (int(b) & 0x7F) << shift
  715. if b < 0x80 {
  716. break
  717. }
  718. }
  719. if length < 0 {
  720. return 0, ErrInvalidLengthTypes
  721. }
  722. iNdEx += length
  723. if iNdEx < 0 {
  724. return 0, ErrInvalidLengthTypes
  725. }
  726. return iNdEx, nil
  727. case 3:
  728. for {
  729. var innerWire uint64
  730. var start int = iNdEx
  731. for shift := uint(0); ; shift += 7 {
  732. if shift >= 64 {
  733. return 0, ErrIntOverflowTypes
  734. }
  735. if iNdEx >= l {
  736. return 0, io.ErrUnexpectedEOF
  737. }
  738. b := dAtA[iNdEx]
  739. iNdEx++
  740. innerWire |= (uint64(b) & 0x7F) << shift
  741. if b < 0x80 {
  742. break
  743. }
  744. }
  745. innerWireType := int(innerWire & 0x7)
  746. if innerWireType == 4 {
  747. break
  748. }
  749. next, err := skipTypes(dAtA[start:])
  750. if err != nil {
  751. return 0, err
  752. }
  753. iNdEx = start + next
  754. if iNdEx < 0 {
  755. return 0, ErrInvalidLengthTypes
  756. }
  757. }
  758. return iNdEx, nil
  759. case 4:
  760. return iNdEx, nil
  761. case 5:
  762. iNdEx += 4
  763. return iNdEx, nil
  764. default:
  765. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  766. }
  767. }
  768. panic("unreachable")
  769. }
  770. var (
  771. ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
  772. ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
  773. )