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.

783 lines
18 KiB

  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: libs/kv/types.proto
  3. package kv
  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 Pair 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 *Pair) Reset() { *m = Pair{} }
  33. func (m *Pair) String() string { return proto.CompactTextString(m) }
  34. func (*Pair) ProtoMessage() {}
  35. func (*Pair) Descriptor() ([]byte, []int) {
  36. return fileDescriptor_31432671d164f444, []int{0}
  37. }
  38. func (m *Pair) XXX_Unmarshal(b []byte) error {
  39. return m.Unmarshal(b)
  40. }
  41. func (m *Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  42. if deterministic {
  43. return xxx_messageInfo_Pair.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 *Pair) XXX_Merge(src proto.Message) {
  54. xxx_messageInfo_Pair.Merge(m, src)
  55. }
  56. func (m *Pair) XXX_Size() int {
  57. return m.Size()
  58. }
  59. func (m *Pair) XXX_DiscardUnknown() {
  60. xxx_messageInfo_Pair.DiscardUnknown(m)
  61. }
  62. var xxx_messageInfo_Pair proto.InternalMessageInfo
  63. func (m *Pair) GetKey() []byte {
  64. if m != nil {
  65. return m.Key
  66. }
  67. return nil
  68. }
  69. func (m *Pair) 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_31432671d164f444, []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((*Pair)(nil), "tendermint.libs.kv.Pair")
  128. golang_proto.RegisterType((*Pair)(nil), "tendermint.libs.kv.Pair")
  129. proto.RegisterType((*KI64Pair)(nil), "tendermint.libs.kv.KI64Pair")
  130. golang_proto.RegisterType((*KI64Pair)(nil), "tendermint.libs.kv.KI64Pair")
  131. }
  132. func init() { proto.RegisterFile("libs/kv/types.proto", fileDescriptor_31432671d164f444) }
  133. func init() { golang_proto.RegisterFile("libs/kv/types.proto", fileDescriptor_31432671d164f444) }
  134. var fileDescriptor_31432671d164f444 = []byte{
  135. // 193 bytes of a gzipped FileDescriptorProto
  136. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xce, 0xc9, 0x4c, 0x2a,
  137. 0xd6, 0xcf, 0x2e, 0xd3, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17,
  138. 0x12, 0x2a, 0x49, 0xcd, 0x4b, 0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x03, 0xc9, 0xeb, 0x65,
  139. 0x97, 0x49, 0xe9, 0xa6, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0xa7, 0xe7,
  140. 0xa7, 0xe7, 0xeb, 0x83, 0x95, 0x26, 0x95, 0xa6, 0x81, 0x79, 0x60, 0x0e, 0x98, 0x05, 0x31, 0x42,
  141. 0x49, 0x8f, 0x8b, 0x25, 0x20, 0x31, 0xb3, 0x48, 0x48, 0x80, 0x8b, 0x39, 0x3b, 0xb5, 0x52, 0x82,
  142. 0x51, 0x81, 0x51, 0x83, 0x27, 0x08, 0xc4, 0x14, 0x12, 0xe1, 0x62, 0x2d, 0x4b, 0xcc, 0x29, 0x4d,
  143. 0x95, 0x60, 0x02, 0x8b, 0x41, 0x38, 0x4a, 0x46, 0x5c, 0x1c, 0xde, 0x9e, 0x66, 0x26, 0xc4, 0xe8,
  144. 0x61, 0x86, 0xea, 0x71, 0x72, 0xfb, 0xf1, 0x50, 0x8e, 0x71, 0xc5, 0x23, 0x39, 0xc6, 0x1d, 0x8f,
  145. 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x03,
  146. 0x8f, 0xe5, 0x18, 0xa3, 0x34, 0x90, 0x1c, 0x8c, 0xf0, 0x0f, 0x32, 0x13, 0xea, 0xf5, 0x24, 0x36,
  147. 0xb0, 0x93, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x01, 0x3f, 0x5a, 0xca, 0x0c, 0x01, 0x00,
  148. 0x00,
  149. }
  150. func (this *Pair) Equal(that interface{}) bool {
  151. if that == nil {
  152. return this == nil
  153. }
  154. that1, ok := that.(*Pair)
  155. if !ok {
  156. that2, ok := that.(Pair)
  157. if ok {
  158. that1 = &that2
  159. } else {
  160. return false
  161. }
  162. }
  163. if that1 == nil {
  164. return this == nil
  165. } else if this == nil {
  166. return false
  167. }
  168. if !bytes.Equal(this.Key, that1.Key) {
  169. return false
  170. }
  171. if !bytes.Equal(this.Value, that1.Value) {
  172. return false
  173. }
  174. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  175. return false
  176. }
  177. return true
  178. }
  179. func (this *KI64Pair) Equal(that interface{}) bool {
  180. if that == nil {
  181. return this == nil
  182. }
  183. that1, ok := that.(*KI64Pair)
  184. if !ok {
  185. that2, ok := that.(KI64Pair)
  186. if ok {
  187. that1 = &that2
  188. } else {
  189. return false
  190. }
  191. }
  192. if that1 == nil {
  193. return this == nil
  194. } else if this == nil {
  195. return false
  196. }
  197. if !bytes.Equal(this.Key, that1.Key) {
  198. return false
  199. }
  200. if this.Value != that1.Value {
  201. return false
  202. }
  203. if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) {
  204. return false
  205. }
  206. return true
  207. }
  208. func (m *Pair) Marshal() (dAtA []byte, err error) {
  209. size := m.Size()
  210. dAtA = make([]byte, size)
  211. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  212. if err != nil {
  213. return nil, err
  214. }
  215. return dAtA[:n], nil
  216. }
  217. func (m *Pair) MarshalTo(dAtA []byte) (int, error) {
  218. size := m.Size()
  219. return m.MarshalToSizedBuffer(dAtA[:size])
  220. }
  221. func (m *Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  222. i := len(dAtA)
  223. _ = i
  224. var l int
  225. _ = l
  226. if m.XXX_unrecognized != nil {
  227. i -= len(m.XXX_unrecognized)
  228. copy(dAtA[i:], m.XXX_unrecognized)
  229. }
  230. if len(m.Value) > 0 {
  231. i -= len(m.Value)
  232. copy(dAtA[i:], m.Value)
  233. i = encodeVarintTypes(dAtA, i, uint64(len(m.Value)))
  234. i--
  235. dAtA[i] = 0x12
  236. }
  237. if len(m.Key) > 0 {
  238. i -= len(m.Key)
  239. copy(dAtA[i:], m.Key)
  240. i = encodeVarintTypes(dAtA, i, uint64(len(m.Key)))
  241. i--
  242. dAtA[i] = 0xa
  243. }
  244. return len(dAtA) - i, nil
  245. }
  246. func (m *KI64Pair) Marshal() (dAtA []byte, err error) {
  247. size := m.Size()
  248. dAtA = make([]byte, size)
  249. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  250. if err != nil {
  251. return nil, err
  252. }
  253. return dAtA[:n], nil
  254. }
  255. func (m *KI64Pair) MarshalTo(dAtA []byte) (int, error) {
  256. size := m.Size()
  257. return m.MarshalToSizedBuffer(dAtA[:size])
  258. }
  259. func (m *KI64Pair) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  260. i := len(dAtA)
  261. _ = i
  262. var l int
  263. _ = l
  264. if m.XXX_unrecognized != nil {
  265. i -= len(m.XXX_unrecognized)
  266. copy(dAtA[i:], m.XXX_unrecognized)
  267. }
  268. if m.Value != 0 {
  269. i = encodeVarintTypes(dAtA, i, uint64(m.Value))
  270. i--
  271. dAtA[i] = 0x10
  272. }
  273. if len(m.Key) > 0 {
  274. i -= len(m.Key)
  275. copy(dAtA[i:], m.Key)
  276. i = encodeVarintTypes(dAtA, i, uint64(len(m.Key)))
  277. i--
  278. dAtA[i] = 0xa
  279. }
  280. return len(dAtA) - i, nil
  281. }
  282. func encodeVarintTypes(dAtA []byte, offset int, v uint64) int {
  283. offset -= sovTypes(v)
  284. base := offset
  285. for v >= 1<<7 {
  286. dAtA[offset] = uint8(v&0x7f | 0x80)
  287. v >>= 7
  288. offset++
  289. }
  290. dAtA[offset] = uint8(v)
  291. return base
  292. }
  293. func NewPopulatedPair(r randyTypes, easy bool) *Pair {
  294. this := &Pair{}
  295. v1 := r.Intn(100)
  296. this.Key = make([]byte, v1)
  297. for i := 0; i < v1; i++ {
  298. this.Key[i] = byte(r.Intn(256))
  299. }
  300. v2 := r.Intn(100)
  301. this.Value = make([]byte, v2)
  302. for i := 0; i < v2; i++ {
  303. this.Value[i] = byte(r.Intn(256))
  304. }
  305. if !easy && r.Intn(10) != 0 {
  306. this.XXX_unrecognized = randUnrecognizedTypes(r, 3)
  307. }
  308. return this
  309. }
  310. func NewPopulatedKI64Pair(r randyTypes, easy bool) *KI64Pair {
  311. this := &KI64Pair{}
  312. v3 := r.Intn(100)
  313. this.Key = make([]byte, v3)
  314. for i := 0; i < v3; i++ {
  315. this.Key[i] = byte(r.Intn(256))
  316. }
  317. this.Value = int64(r.Int63())
  318. if r.Intn(2) == 0 {
  319. this.Value *= -1
  320. }
  321. if !easy && r.Intn(10) != 0 {
  322. this.XXX_unrecognized = randUnrecognizedTypes(r, 3)
  323. }
  324. return this
  325. }
  326. type randyTypes interface {
  327. Float32() float32
  328. Float64() float64
  329. Int63() int64
  330. Int31() int32
  331. Uint32() uint32
  332. Intn(n int) int
  333. }
  334. func randUTF8RuneTypes(r randyTypes) rune {
  335. ru := r.Intn(62)
  336. if ru < 10 {
  337. return rune(ru + 48)
  338. } else if ru < 36 {
  339. return rune(ru + 55)
  340. }
  341. return rune(ru + 61)
  342. }
  343. func randStringTypes(r randyTypes) string {
  344. v4 := r.Intn(100)
  345. tmps := make([]rune, v4)
  346. for i := 0; i < v4; i++ {
  347. tmps[i] = randUTF8RuneTypes(r)
  348. }
  349. return string(tmps)
  350. }
  351. func randUnrecognizedTypes(r randyTypes, maxFieldNumber int) (dAtA []byte) {
  352. l := r.Intn(5)
  353. for i := 0; i < l; i++ {
  354. wire := r.Intn(4)
  355. if wire == 3 {
  356. wire = 5
  357. }
  358. fieldNumber := maxFieldNumber + r.Intn(100)
  359. dAtA = randFieldTypes(dAtA, r, fieldNumber, wire)
  360. }
  361. return dAtA
  362. }
  363. func randFieldTypes(dAtA []byte, r randyTypes, fieldNumber int, wire int) []byte {
  364. key := uint32(fieldNumber)<<3 | uint32(wire)
  365. switch wire {
  366. case 0:
  367. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  368. v5 := r.Int63()
  369. if r.Intn(2) == 0 {
  370. v5 *= -1
  371. }
  372. dAtA = encodeVarintPopulateTypes(dAtA, uint64(v5))
  373. case 1:
  374. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  375. 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)))
  376. case 2:
  377. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  378. ll := r.Intn(100)
  379. dAtA = encodeVarintPopulateTypes(dAtA, uint64(ll))
  380. for j := 0; j < ll; j++ {
  381. dAtA = append(dAtA, byte(r.Intn(256)))
  382. }
  383. default:
  384. dAtA = encodeVarintPopulateTypes(dAtA, uint64(key))
  385. dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))
  386. }
  387. return dAtA
  388. }
  389. func encodeVarintPopulateTypes(dAtA []byte, v uint64) []byte {
  390. for v >= 1<<7 {
  391. dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))
  392. v >>= 7
  393. }
  394. dAtA = append(dAtA, uint8(v))
  395. return dAtA
  396. }
  397. func (m *Pair) Size() (n int) {
  398. if m == nil {
  399. return 0
  400. }
  401. var l int
  402. _ = l
  403. l = len(m.Key)
  404. if l > 0 {
  405. n += 1 + l + sovTypes(uint64(l))
  406. }
  407. l = len(m.Value)
  408. if l > 0 {
  409. n += 1 + l + sovTypes(uint64(l))
  410. }
  411. if m.XXX_unrecognized != nil {
  412. n += len(m.XXX_unrecognized)
  413. }
  414. return n
  415. }
  416. func (m *KI64Pair) Size() (n int) {
  417. if m == nil {
  418. return 0
  419. }
  420. var l int
  421. _ = l
  422. l = len(m.Key)
  423. if l > 0 {
  424. n += 1 + l + sovTypes(uint64(l))
  425. }
  426. if m.Value != 0 {
  427. n += 1 + sovTypes(uint64(m.Value))
  428. }
  429. if m.XXX_unrecognized != nil {
  430. n += len(m.XXX_unrecognized)
  431. }
  432. return n
  433. }
  434. func sovTypes(x uint64) (n int) {
  435. return (math_bits.Len64(x|1) + 6) / 7
  436. }
  437. func sozTypes(x uint64) (n int) {
  438. return sovTypes(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  439. }
  440. func (m *Pair) Unmarshal(dAtA []byte) error {
  441. l := len(dAtA)
  442. iNdEx := 0
  443. for iNdEx < l {
  444. preIndex := iNdEx
  445. var wire uint64
  446. for shift := uint(0); ; shift += 7 {
  447. if shift >= 64 {
  448. return ErrIntOverflowTypes
  449. }
  450. if iNdEx >= l {
  451. return io.ErrUnexpectedEOF
  452. }
  453. b := dAtA[iNdEx]
  454. iNdEx++
  455. wire |= uint64(b&0x7F) << shift
  456. if b < 0x80 {
  457. break
  458. }
  459. }
  460. fieldNum := int32(wire >> 3)
  461. wireType := int(wire & 0x7)
  462. if wireType == 4 {
  463. return fmt.Errorf("proto: Pair: wiretype end group for non-group")
  464. }
  465. if fieldNum <= 0 {
  466. return fmt.Errorf("proto: Pair: illegal tag %d (wire type %d)", fieldNum, wire)
  467. }
  468. switch fieldNum {
  469. case 1:
  470. if wireType != 2 {
  471. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  472. }
  473. var byteLen int
  474. for shift := uint(0); ; shift += 7 {
  475. if shift >= 64 {
  476. return ErrIntOverflowTypes
  477. }
  478. if iNdEx >= l {
  479. return io.ErrUnexpectedEOF
  480. }
  481. b := dAtA[iNdEx]
  482. iNdEx++
  483. byteLen |= int(b&0x7F) << shift
  484. if b < 0x80 {
  485. break
  486. }
  487. }
  488. if byteLen < 0 {
  489. return ErrInvalidLengthTypes
  490. }
  491. postIndex := iNdEx + byteLen
  492. if postIndex < 0 {
  493. return ErrInvalidLengthTypes
  494. }
  495. if postIndex > l {
  496. return io.ErrUnexpectedEOF
  497. }
  498. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  499. if m.Key == nil {
  500. m.Key = []byte{}
  501. }
  502. iNdEx = postIndex
  503. case 2:
  504. if wireType != 2 {
  505. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  506. }
  507. var byteLen int
  508. for shift := uint(0); ; shift += 7 {
  509. if shift >= 64 {
  510. return ErrIntOverflowTypes
  511. }
  512. if iNdEx >= l {
  513. return io.ErrUnexpectedEOF
  514. }
  515. b := dAtA[iNdEx]
  516. iNdEx++
  517. byteLen |= int(b&0x7F) << shift
  518. if b < 0x80 {
  519. break
  520. }
  521. }
  522. if byteLen < 0 {
  523. return ErrInvalidLengthTypes
  524. }
  525. postIndex := iNdEx + byteLen
  526. if postIndex < 0 {
  527. return ErrInvalidLengthTypes
  528. }
  529. if postIndex > l {
  530. return io.ErrUnexpectedEOF
  531. }
  532. m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
  533. if m.Value == nil {
  534. m.Value = []byte{}
  535. }
  536. iNdEx = postIndex
  537. default:
  538. iNdEx = preIndex
  539. skippy, err := skipTypes(dAtA[iNdEx:])
  540. if err != nil {
  541. return err
  542. }
  543. if skippy < 0 {
  544. return ErrInvalidLengthTypes
  545. }
  546. if (iNdEx + skippy) < 0 {
  547. return ErrInvalidLengthTypes
  548. }
  549. if (iNdEx + skippy) > l {
  550. return io.ErrUnexpectedEOF
  551. }
  552. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  553. iNdEx += skippy
  554. }
  555. }
  556. if iNdEx > l {
  557. return io.ErrUnexpectedEOF
  558. }
  559. return nil
  560. }
  561. func (m *KI64Pair) Unmarshal(dAtA []byte) error {
  562. l := len(dAtA)
  563. iNdEx := 0
  564. for iNdEx < l {
  565. preIndex := iNdEx
  566. var wire uint64
  567. for shift := uint(0); ; shift += 7 {
  568. if shift >= 64 {
  569. return ErrIntOverflowTypes
  570. }
  571. if iNdEx >= l {
  572. return io.ErrUnexpectedEOF
  573. }
  574. b := dAtA[iNdEx]
  575. iNdEx++
  576. wire |= uint64(b&0x7F) << shift
  577. if b < 0x80 {
  578. break
  579. }
  580. }
  581. fieldNum := int32(wire >> 3)
  582. wireType := int(wire & 0x7)
  583. if wireType == 4 {
  584. return fmt.Errorf("proto: KI64Pair: wiretype end group for non-group")
  585. }
  586. if fieldNum <= 0 {
  587. return fmt.Errorf("proto: KI64Pair: illegal tag %d (wire type %d)", fieldNum, wire)
  588. }
  589. switch fieldNum {
  590. case 1:
  591. if wireType != 2 {
  592. return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
  593. }
  594. var byteLen int
  595. for shift := uint(0); ; shift += 7 {
  596. if shift >= 64 {
  597. return ErrIntOverflowTypes
  598. }
  599. if iNdEx >= l {
  600. return io.ErrUnexpectedEOF
  601. }
  602. b := dAtA[iNdEx]
  603. iNdEx++
  604. byteLen |= int(b&0x7F) << shift
  605. if b < 0x80 {
  606. break
  607. }
  608. }
  609. if byteLen < 0 {
  610. return ErrInvalidLengthTypes
  611. }
  612. postIndex := iNdEx + byteLen
  613. if postIndex < 0 {
  614. return ErrInvalidLengthTypes
  615. }
  616. if postIndex > l {
  617. return io.ErrUnexpectedEOF
  618. }
  619. m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
  620. if m.Key == nil {
  621. m.Key = []byte{}
  622. }
  623. iNdEx = postIndex
  624. case 2:
  625. if wireType != 0 {
  626. return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
  627. }
  628. m.Value = 0
  629. for shift := uint(0); ; shift += 7 {
  630. if shift >= 64 {
  631. return ErrIntOverflowTypes
  632. }
  633. if iNdEx >= l {
  634. return io.ErrUnexpectedEOF
  635. }
  636. b := dAtA[iNdEx]
  637. iNdEx++
  638. m.Value |= int64(b&0x7F) << shift
  639. if b < 0x80 {
  640. break
  641. }
  642. }
  643. default:
  644. iNdEx = preIndex
  645. skippy, err := skipTypes(dAtA[iNdEx:])
  646. if err != nil {
  647. return err
  648. }
  649. if skippy < 0 {
  650. return ErrInvalidLengthTypes
  651. }
  652. if (iNdEx + skippy) < 0 {
  653. return ErrInvalidLengthTypes
  654. }
  655. if (iNdEx + skippy) > l {
  656. return io.ErrUnexpectedEOF
  657. }
  658. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  659. iNdEx += skippy
  660. }
  661. }
  662. if iNdEx > l {
  663. return io.ErrUnexpectedEOF
  664. }
  665. return nil
  666. }
  667. func skipTypes(dAtA []byte) (n int, err error) {
  668. l := len(dAtA)
  669. iNdEx := 0
  670. depth := 0
  671. for iNdEx < l {
  672. var wire uint64
  673. for shift := uint(0); ; shift += 7 {
  674. if shift >= 64 {
  675. return 0, ErrIntOverflowTypes
  676. }
  677. if iNdEx >= l {
  678. return 0, io.ErrUnexpectedEOF
  679. }
  680. b := dAtA[iNdEx]
  681. iNdEx++
  682. wire |= (uint64(b) & 0x7F) << shift
  683. if b < 0x80 {
  684. break
  685. }
  686. }
  687. wireType := int(wire & 0x7)
  688. switch wireType {
  689. case 0:
  690. for shift := uint(0); ; shift += 7 {
  691. if shift >= 64 {
  692. return 0, ErrIntOverflowTypes
  693. }
  694. if iNdEx >= l {
  695. return 0, io.ErrUnexpectedEOF
  696. }
  697. iNdEx++
  698. if dAtA[iNdEx-1] < 0x80 {
  699. break
  700. }
  701. }
  702. case 1:
  703. iNdEx += 8
  704. case 2:
  705. var length int
  706. for shift := uint(0); ; shift += 7 {
  707. if shift >= 64 {
  708. return 0, ErrIntOverflowTypes
  709. }
  710. if iNdEx >= l {
  711. return 0, io.ErrUnexpectedEOF
  712. }
  713. b := dAtA[iNdEx]
  714. iNdEx++
  715. length |= (int(b) & 0x7F) << shift
  716. if b < 0x80 {
  717. break
  718. }
  719. }
  720. if length < 0 {
  721. return 0, ErrInvalidLengthTypes
  722. }
  723. iNdEx += length
  724. case 3:
  725. depth++
  726. case 4:
  727. if depth == 0 {
  728. return 0, ErrUnexpectedEndOfGroupTypes
  729. }
  730. depth--
  731. case 5:
  732. iNdEx += 4
  733. default:
  734. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  735. }
  736. if iNdEx < 0 {
  737. return 0, ErrInvalidLengthTypes
  738. }
  739. if depth == 0 {
  740. return iNdEx, nil
  741. }
  742. }
  743. return 0, io.ErrUnexpectedEOF
  744. }
  745. var (
  746. ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling")
  747. ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow")
  748. ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
  749. )