raft_internal.pb.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. // Code generated by protoc-gen-gogo.
  2. // source: raft_internal.proto
  3. // DO NOT EDIT!
  4. package etcdserverpb
  5. import (
  6. "fmt"
  7. proto "github.com/coreos/etcd/Godeps/_workspace/src/github.com/gogo/protobuf/proto"
  8. )
  9. import math "math"
  10. import io "io"
  11. // Reference imports to suppress errors if they are not otherwise used.
  12. var _ = proto.Marshal
  13. var _ = fmt.Errorf
  14. var _ = math.Inf
  15. // An InternalRaftRequest is the union of all requests which can be
  16. // sent via raft.
  17. type InternalRaftRequest struct {
  18. ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
  19. V2 *Request `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"`
  20. Range *RangeRequest `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"`
  21. Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"`
  22. DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range" json:"delete_range,omitempty"`
  23. Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"`
  24. Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"`
  25. LeaseCreate *LeaseCreateRequest `protobuf:"bytes,8,opt,name=lease_create" json:"lease_create,omitempty"`
  26. LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke" json:"lease_revoke,omitempty"`
  27. }
  28. func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} }
  29. func (m *InternalRaftRequest) String() string { return proto.CompactTextString(m) }
  30. func (*InternalRaftRequest) ProtoMessage() {}
  31. type EmptyResponse struct {
  32. }
  33. func (m *EmptyResponse) Reset() { *m = EmptyResponse{} }
  34. func (m *EmptyResponse) String() string { return proto.CompactTextString(m) }
  35. func (*EmptyResponse) ProtoMessage() {}
  36. func init() {
  37. proto.RegisterType((*InternalRaftRequest)(nil), "etcdserverpb.InternalRaftRequest")
  38. proto.RegisterType((*EmptyResponse)(nil), "etcdserverpb.EmptyResponse")
  39. }
  40. func (m *InternalRaftRequest) Marshal() (data []byte, err error) {
  41. size := m.Size()
  42. data = make([]byte, size)
  43. n, err := m.MarshalTo(data)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return data[:n], nil
  48. }
  49. func (m *InternalRaftRequest) MarshalTo(data []byte) (int, error) {
  50. var i int
  51. _ = i
  52. var l int
  53. _ = l
  54. if m.ID != 0 {
  55. data[i] = 0x8
  56. i++
  57. i = encodeVarintRaftInternal(data, i, uint64(m.ID))
  58. }
  59. if m.V2 != nil {
  60. data[i] = 0x12
  61. i++
  62. i = encodeVarintRaftInternal(data, i, uint64(m.V2.Size()))
  63. n1, err := m.V2.MarshalTo(data[i:])
  64. if err != nil {
  65. return 0, err
  66. }
  67. i += n1
  68. }
  69. if m.Range != nil {
  70. data[i] = 0x1a
  71. i++
  72. i = encodeVarintRaftInternal(data, i, uint64(m.Range.Size()))
  73. n2, err := m.Range.MarshalTo(data[i:])
  74. if err != nil {
  75. return 0, err
  76. }
  77. i += n2
  78. }
  79. if m.Put != nil {
  80. data[i] = 0x22
  81. i++
  82. i = encodeVarintRaftInternal(data, i, uint64(m.Put.Size()))
  83. n3, err := m.Put.MarshalTo(data[i:])
  84. if err != nil {
  85. return 0, err
  86. }
  87. i += n3
  88. }
  89. if m.DeleteRange != nil {
  90. data[i] = 0x2a
  91. i++
  92. i = encodeVarintRaftInternal(data, i, uint64(m.DeleteRange.Size()))
  93. n4, err := m.DeleteRange.MarshalTo(data[i:])
  94. if err != nil {
  95. return 0, err
  96. }
  97. i += n4
  98. }
  99. if m.Txn != nil {
  100. data[i] = 0x32
  101. i++
  102. i = encodeVarintRaftInternal(data, i, uint64(m.Txn.Size()))
  103. n5, err := m.Txn.MarshalTo(data[i:])
  104. if err != nil {
  105. return 0, err
  106. }
  107. i += n5
  108. }
  109. if m.Compaction != nil {
  110. data[i] = 0x3a
  111. i++
  112. i = encodeVarintRaftInternal(data, i, uint64(m.Compaction.Size()))
  113. n6, err := m.Compaction.MarshalTo(data[i:])
  114. if err != nil {
  115. return 0, err
  116. }
  117. i += n6
  118. }
  119. if m.LeaseCreate != nil {
  120. data[i] = 0x42
  121. i++
  122. i = encodeVarintRaftInternal(data, i, uint64(m.LeaseCreate.Size()))
  123. n7, err := m.LeaseCreate.MarshalTo(data[i:])
  124. if err != nil {
  125. return 0, err
  126. }
  127. i += n7
  128. }
  129. if m.LeaseRevoke != nil {
  130. data[i] = 0x4a
  131. i++
  132. i = encodeVarintRaftInternal(data, i, uint64(m.LeaseRevoke.Size()))
  133. n8, err := m.LeaseRevoke.MarshalTo(data[i:])
  134. if err != nil {
  135. return 0, err
  136. }
  137. i += n8
  138. }
  139. return i, nil
  140. }
  141. func (m *EmptyResponse) Marshal() (data []byte, err error) {
  142. size := m.Size()
  143. data = make([]byte, size)
  144. n, err := m.MarshalTo(data)
  145. if err != nil {
  146. return nil, err
  147. }
  148. return data[:n], nil
  149. }
  150. func (m *EmptyResponse) MarshalTo(data []byte) (int, error) {
  151. var i int
  152. _ = i
  153. var l int
  154. _ = l
  155. return i, nil
  156. }
  157. func encodeFixed64RaftInternal(data []byte, offset int, v uint64) int {
  158. data[offset] = uint8(v)
  159. data[offset+1] = uint8(v >> 8)
  160. data[offset+2] = uint8(v >> 16)
  161. data[offset+3] = uint8(v >> 24)
  162. data[offset+4] = uint8(v >> 32)
  163. data[offset+5] = uint8(v >> 40)
  164. data[offset+6] = uint8(v >> 48)
  165. data[offset+7] = uint8(v >> 56)
  166. return offset + 8
  167. }
  168. func encodeFixed32RaftInternal(data []byte, offset int, v uint32) int {
  169. data[offset] = uint8(v)
  170. data[offset+1] = uint8(v >> 8)
  171. data[offset+2] = uint8(v >> 16)
  172. data[offset+3] = uint8(v >> 24)
  173. return offset + 4
  174. }
  175. func encodeVarintRaftInternal(data []byte, offset int, v uint64) int {
  176. for v >= 1<<7 {
  177. data[offset] = uint8(v&0x7f | 0x80)
  178. v >>= 7
  179. offset++
  180. }
  181. data[offset] = uint8(v)
  182. return offset + 1
  183. }
  184. func (m *InternalRaftRequest) Size() (n int) {
  185. var l int
  186. _ = l
  187. if m.ID != 0 {
  188. n += 1 + sovRaftInternal(uint64(m.ID))
  189. }
  190. if m.V2 != nil {
  191. l = m.V2.Size()
  192. n += 1 + l + sovRaftInternal(uint64(l))
  193. }
  194. if m.Range != nil {
  195. l = m.Range.Size()
  196. n += 1 + l + sovRaftInternal(uint64(l))
  197. }
  198. if m.Put != nil {
  199. l = m.Put.Size()
  200. n += 1 + l + sovRaftInternal(uint64(l))
  201. }
  202. if m.DeleteRange != nil {
  203. l = m.DeleteRange.Size()
  204. n += 1 + l + sovRaftInternal(uint64(l))
  205. }
  206. if m.Txn != nil {
  207. l = m.Txn.Size()
  208. n += 1 + l + sovRaftInternal(uint64(l))
  209. }
  210. if m.Compaction != nil {
  211. l = m.Compaction.Size()
  212. n += 1 + l + sovRaftInternal(uint64(l))
  213. }
  214. if m.LeaseCreate != nil {
  215. l = m.LeaseCreate.Size()
  216. n += 1 + l + sovRaftInternal(uint64(l))
  217. }
  218. if m.LeaseRevoke != nil {
  219. l = m.LeaseRevoke.Size()
  220. n += 1 + l + sovRaftInternal(uint64(l))
  221. }
  222. return n
  223. }
  224. func (m *EmptyResponse) Size() (n int) {
  225. var l int
  226. _ = l
  227. return n
  228. }
  229. func sovRaftInternal(x uint64) (n int) {
  230. for {
  231. n++
  232. x >>= 7
  233. if x == 0 {
  234. break
  235. }
  236. }
  237. return n
  238. }
  239. func sozRaftInternal(x uint64) (n int) {
  240. return sovRaftInternal(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  241. }
  242. func (m *InternalRaftRequest) Unmarshal(data []byte) error {
  243. l := len(data)
  244. iNdEx := 0
  245. for iNdEx < l {
  246. preIndex := iNdEx
  247. var wire uint64
  248. for shift := uint(0); ; shift += 7 {
  249. if shift >= 64 {
  250. return ErrIntOverflowRaftInternal
  251. }
  252. if iNdEx >= l {
  253. return io.ErrUnexpectedEOF
  254. }
  255. b := data[iNdEx]
  256. iNdEx++
  257. wire |= (uint64(b) & 0x7F) << shift
  258. if b < 0x80 {
  259. break
  260. }
  261. }
  262. fieldNum := int32(wire >> 3)
  263. wireType := int(wire & 0x7)
  264. if wireType == 4 {
  265. return fmt.Errorf("proto: InternalRaftRequest: wiretype end group for non-group")
  266. }
  267. if fieldNum <= 0 {
  268. return fmt.Errorf("proto: InternalRaftRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  269. }
  270. switch fieldNum {
  271. case 1:
  272. if wireType != 0 {
  273. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  274. }
  275. m.ID = 0
  276. for shift := uint(0); ; shift += 7 {
  277. if shift >= 64 {
  278. return ErrIntOverflowRaftInternal
  279. }
  280. if iNdEx >= l {
  281. return io.ErrUnexpectedEOF
  282. }
  283. b := data[iNdEx]
  284. iNdEx++
  285. m.ID |= (uint64(b) & 0x7F) << shift
  286. if b < 0x80 {
  287. break
  288. }
  289. }
  290. case 2:
  291. if wireType != 2 {
  292. return fmt.Errorf("proto: wrong wireType = %d for field V2", wireType)
  293. }
  294. var msglen int
  295. for shift := uint(0); ; shift += 7 {
  296. if shift >= 64 {
  297. return ErrIntOverflowRaftInternal
  298. }
  299. if iNdEx >= l {
  300. return io.ErrUnexpectedEOF
  301. }
  302. b := data[iNdEx]
  303. iNdEx++
  304. msglen |= (int(b) & 0x7F) << shift
  305. if b < 0x80 {
  306. break
  307. }
  308. }
  309. if msglen < 0 {
  310. return ErrInvalidLengthRaftInternal
  311. }
  312. postIndex := iNdEx + msglen
  313. if postIndex > l {
  314. return io.ErrUnexpectedEOF
  315. }
  316. if m.V2 == nil {
  317. m.V2 = &Request{}
  318. }
  319. if err := m.V2.Unmarshal(data[iNdEx:postIndex]); err != nil {
  320. return err
  321. }
  322. iNdEx = postIndex
  323. case 3:
  324. if wireType != 2 {
  325. return fmt.Errorf("proto: wrong wireType = %d for field Range", wireType)
  326. }
  327. var msglen int
  328. for shift := uint(0); ; shift += 7 {
  329. if shift >= 64 {
  330. return ErrIntOverflowRaftInternal
  331. }
  332. if iNdEx >= l {
  333. return io.ErrUnexpectedEOF
  334. }
  335. b := data[iNdEx]
  336. iNdEx++
  337. msglen |= (int(b) & 0x7F) << shift
  338. if b < 0x80 {
  339. break
  340. }
  341. }
  342. if msglen < 0 {
  343. return ErrInvalidLengthRaftInternal
  344. }
  345. postIndex := iNdEx + msglen
  346. if postIndex > l {
  347. return io.ErrUnexpectedEOF
  348. }
  349. if m.Range == nil {
  350. m.Range = &RangeRequest{}
  351. }
  352. if err := m.Range.Unmarshal(data[iNdEx:postIndex]); err != nil {
  353. return err
  354. }
  355. iNdEx = postIndex
  356. case 4:
  357. if wireType != 2 {
  358. return fmt.Errorf("proto: wrong wireType = %d for field Put", wireType)
  359. }
  360. var msglen int
  361. for shift := uint(0); ; shift += 7 {
  362. if shift >= 64 {
  363. return ErrIntOverflowRaftInternal
  364. }
  365. if iNdEx >= l {
  366. return io.ErrUnexpectedEOF
  367. }
  368. b := data[iNdEx]
  369. iNdEx++
  370. msglen |= (int(b) & 0x7F) << shift
  371. if b < 0x80 {
  372. break
  373. }
  374. }
  375. if msglen < 0 {
  376. return ErrInvalidLengthRaftInternal
  377. }
  378. postIndex := iNdEx + msglen
  379. if postIndex > l {
  380. return io.ErrUnexpectedEOF
  381. }
  382. if m.Put == nil {
  383. m.Put = &PutRequest{}
  384. }
  385. if err := m.Put.Unmarshal(data[iNdEx:postIndex]); err != nil {
  386. return err
  387. }
  388. iNdEx = postIndex
  389. case 5:
  390. if wireType != 2 {
  391. return fmt.Errorf("proto: wrong wireType = %d for field DeleteRange", wireType)
  392. }
  393. var msglen int
  394. for shift := uint(0); ; shift += 7 {
  395. if shift >= 64 {
  396. return ErrIntOverflowRaftInternal
  397. }
  398. if iNdEx >= l {
  399. return io.ErrUnexpectedEOF
  400. }
  401. b := data[iNdEx]
  402. iNdEx++
  403. msglen |= (int(b) & 0x7F) << shift
  404. if b < 0x80 {
  405. break
  406. }
  407. }
  408. if msglen < 0 {
  409. return ErrInvalidLengthRaftInternal
  410. }
  411. postIndex := iNdEx + msglen
  412. if postIndex > l {
  413. return io.ErrUnexpectedEOF
  414. }
  415. if m.DeleteRange == nil {
  416. m.DeleteRange = &DeleteRangeRequest{}
  417. }
  418. if err := m.DeleteRange.Unmarshal(data[iNdEx:postIndex]); err != nil {
  419. return err
  420. }
  421. iNdEx = postIndex
  422. case 6:
  423. if wireType != 2 {
  424. return fmt.Errorf("proto: wrong wireType = %d for field Txn", wireType)
  425. }
  426. var msglen int
  427. for shift := uint(0); ; shift += 7 {
  428. if shift >= 64 {
  429. return ErrIntOverflowRaftInternal
  430. }
  431. if iNdEx >= l {
  432. return io.ErrUnexpectedEOF
  433. }
  434. b := data[iNdEx]
  435. iNdEx++
  436. msglen |= (int(b) & 0x7F) << shift
  437. if b < 0x80 {
  438. break
  439. }
  440. }
  441. if msglen < 0 {
  442. return ErrInvalidLengthRaftInternal
  443. }
  444. postIndex := iNdEx + msglen
  445. if postIndex > l {
  446. return io.ErrUnexpectedEOF
  447. }
  448. if m.Txn == nil {
  449. m.Txn = &TxnRequest{}
  450. }
  451. if err := m.Txn.Unmarshal(data[iNdEx:postIndex]); err != nil {
  452. return err
  453. }
  454. iNdEx = postIndex
  455. case 7:
  456. if wireType != 2 {
  457. return fmt.Errorf("proto: wrong wireType = %d for field Compaction", wireType)
  458. }
  459. var msglen int
  460. for shift := uint(0); ; shift += 7 {
  461. if shift >= 64 {
  462. return ErrIntOverflowRaftInternal
  463. }
  464. if iNdEx >= l {
  465. return io.ErrUnexpectedEOF
  466. }
  467. b := data[iNdEx]
  468. iNdEx++
  469. msglen |= (int(b) & 0x7F) << shift
  470. if b < 0x80 {
  471. break
  472. }
  473. }
  474. if msglen < 0 {
  475. return ErrInvalidLengthRaftInternal
  476. }
  477. postIndex := iNdEx + msglen
  478. if postIndex > l {
  479. return io.ErrUnexpectedEOF
  480. }
  481. if m.Compaction == nil {
  482. m.Compaction = &CompactionRequest{}
  483. }
  484. if err := m.Compaction.Unmarshal(data[iNdEx:postIndex]); err != nil {
  485. return err
  486. }
  487. iNdEx = postIndex
  488. case 8:
  489. if wireType != 2 {
  490. return fmt.Errorf("proto: wrong wireType = %d for field LeaseCreate", wireType)
  491. }
  492. var msglen int
  493. for shift := uint(0); ; shift += 7 {
  494. if shift >= 64 {
  495. return ErrIntOverflowRaftInternal
  496. }
  497. if iNdEx >= l {
  498. return io.ErrUnexpectedEOF
  499. }
  500. b := data[iNdEx]
  501. iNdEx++
  502. msglen |= (int(b) & 0x7F) << shift
  503. if b < 0x80 {
  504. break
  505. }
  506. }
  507. if msglen < 0 {
  508. return ErrInvalidLengthRaftInternal
  509. }
  510. postIndex := iNdEx + msglen
  511. if postIndex > l {
  512. return io.ErrUnexpectedEOF
  513. }
  514. if m.LeaseCreate == nil {
  515. m.LeaseCreate = &LeaseCreateRequest{}
  516. }
  517. if err := m.LeaseCreate.Unmarshal(data[iNdEx:postIndex]); err != nil {
  518. return err
  519. }
  520. iNdEx = postIndex
  521. case 9:
  522. if wireType != 2 {
  523. return fmt.Errorf("proto: wrong wireType = %d for field LeaseRevoke", wireType)
  524. }
  525. var msglen int
  526. for shift := uint(0); ; shift += 7 {
  527. if shift >= 64 {
  528. return ErrIntOverflowRaftInternal
  529. }
  530. if iNdEx >= l {
  531. return io.ErrUnexpectedEOF
  532. }
  533. b := data[iNdEx]
  534. iNdEx++
  535. msglen |= (int(b) & 0x7F) << shift
  536. if b < 0x80 {
  537. break
  538. }
  539. }
  540. if msglen < 0 {
  541. return ErrInvalidLengthRaftInternal
  542. }
  543. postIndex := iNdEx + msglen
  544. if postIndex > l {
  545. return io.ErrUnexpectedEOF
  546. }
  547. if m.LeaseRevoke == nil {
  548. m.LeaseRevoke = &LeaseRevokeRequest{}
  549. }
  550. if err := m.LeaseRevoke.Unmarshal(data[iNdEx:postIndex]); err != nil {
  551. return err
  552. }
  553. iNdEx = postIndex
  554. default:
  555. iNdEx = preIndex
  556. skippy, err := skipRaftInternal(data[iNdEx:])
  557. if err != nil {
  558. return err
  559. }
  560. if skippy < 0 {
  561. return ErrInvalidLengthRaftInternal
  562. }
  563. if (iNdEx + skippy) > l {
  564. return io.ErrUnexpectedEOF
  565. }
  566. iNdEx += skippy
  567. }
  568. }
  569. if iNdEx > l {
  570. return io.ErrUnexpectedEOF
  571. }
  572. return nil
  573. }
  574. func (m *EmptyResponse) Unmarshal(data []byte) error {
  575. l := len(data)
  576. iNdEx := 0
  577. for iNdEx < l {
  578. preIndex := iNdEx
  579. var wire uint64
  580. for shift := uint(0); ; shift += 7 {
  581. if shift >= 64 {
  582. return ErrIntOverflowRaftInternal
  583. }
  584. if iNdEx >= l {
  585. return io.ErrUnexpectedEOF
  586. }
  587. b := data[iNdEx]
  588. iNdEx++
  589. wire |= (uint64(b) & 0x7F) << shift
  590. if b < 0x80 {
  591. break
  592. }
  593. }
  594. fieldNum := int32(wire >> 3)
  595. wireType := int(wire & 0x7)
  596. if wireType == 4 {
  597. return fmt.Errorf("proto: EmptyResponse: wiretype end group for non-group")
  598. }
  599. if fieldNum <= 0 {
  600. return fmt.Errorf("proto: EmptyResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  601. }
  602. switch fieldNum {
  603. default:
  604. iNdEx = preIndex
  605. skippy, err := skipRaftInternal(data[iNdEx:])
  606. if err != nil {
  607. return err
  608. }
  609. if skippy < 0 {
  610. return ErrInvalidLengthRaftInternal
  611. }
  612. if (iNdEx + skippy) > l {
  613. return io.ErrUnexpectedEOF
  614. }
  615. iNdEx += skippy
  616. }
  617. }
  618. if iNdEx > l {
  619. return io.ErrUnexpectedEOF
  620. }
  621. return nil
  622. }
  623. func skipRaftInternal(data []byte) (n int, err error) {
  624. l := len(data)
  625. iNdEx := 0
  626. for iNdEx < l {
  627. var wire uint64
  628. for shift := uint(0); ; shift += 7 {
  629. if shift >= 64 {
  630. return 0, ErrIntOverflowRaftInternal
  631. }
  632. if iNdEx >= l {
  633. return 0, io.ErrUnexpectedEOF
  634. }
  635. b := data[iNdEx]
  636. iNdEx++
  637. wire |= (uint64(b) & 0x7F) << shift
  638. if b < 0x80 {
  639. break
  640. }
  641. }
  642. wireType := int(wire & 0x7)
  643. switch wireType {
  644. case 0:
  645. for shift := uint(0); ; shift += 7 {
  646. if shift >= 64 {
  647. return 0, ErrIntOverflowRaftInternal
  648. }
  649. if iNdEx >= l {
  650. return 0, io.ErrUnexpectedEOF
  651. }
  652. iNdEx++
  653. if data[iNdEx-1] < 0x80 {
  654. break
  655. }
  656. }
  657. return iNdEx, nil
  658. case 1:
  659. iNdEx += 8
  660. return iNdEx, nil
  661. case 2:
  662. var length int
  663. for shift := uint(0); ; shift += 7 {
  664. if shift >= 64 {
  665. return 0, ErrIntOverflowRaftInternal
  666. }
  667. if iNdEx >= l {
  668. return 0, io.ErrUnexpectedEOF
  669. }
  670. b := data[iNdEx]
  671. iNdEx++
  672. length |= (int(b) & 0x7F) << shift
  673. if b < 0x80 {
  674. break
  675. }
  676. }
  677. iNdEx += length
  678. if length < 0 {
  679. return 0, ErrInvalidLengthRaftInternal
  680. }
  681. return iNdEx, nil
  682. case 3:
  683. for {
  684. var innerWire uint64
  685. var start int = iNdEx
  686. for shift := uint(0); ; shift += 7 {
  687. if shift >= 64 {
  688. return 0, ErrIntOverflowRaftInternal
  689. }
  690. if iNdEx >= l {
  691. return 0, io.ErrUnexpectedEOF
  692. }
  693. b := data[iNdEx]
  694. iNdEx++
  695. innerWire |= (uint64(b) & 0x7F) << shift
  696. if b < 0x80 {
  697. break
  698. }
  699. }
  700. innerWireType := int(innerWire & 0x7)
  701. if innerWireType == 4 {
  702. break
  703. }
  704. next, err := skipRaftInternal(data[start:])
  705. if err != nil {
  706. return 0, err
  707. }
  708. iNdEx = start + next
  709. }
  710. return iNdEx, nil
  711. case 4:
  712. return iNdEx, nil
  713. case 5:
  714. iNdEx += 4
  715. return iNdEx, nil
  716. default:
  717. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  718. }
  719. }
  720. panic("unreachable")
  721. }
  722. var (
  723. ErrInvalidLengthRaftInternal = fmt.Errorf("proto: negative length found during unmarshaling")
  724. ErrIntOverflowRaftInternal = fmt.Errorf("proto: integer overflow")
  725. )