lease.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. // Code generated by protoc-gen-gogo.
  2. // source: lease.proto
  3. // DO NOT EDIT!
  4. /*
  5. Package leasepb is a generated protocol buffer package.
  6. It is generated from these files:
  7. lease.proto
  8. It has these top-level messages:
  9. Lease
  10. LeaseInternalRequest
  11. LeaseInternalResponse
  12. */
  13. package leasepb
  14. import (
  15. "fmt"
  16. proto "github.com/golang/protobuf/proto"
  17. math "math"
  18. etcdserverpb "github.com/coreos/etcd/etcdserver/etcdserverpb"
  19. io "io"
  20. )
  21. // Reference imports to suppress errors if they are not otherwise used.
  22. var _ = proto.Marshal
  23. var _ = fmt.Errorf
  24. var _ = math.Inf
  25. // This is a compile-time assertion to ensure that this generated file
  26. // is compatible with the proto package it is being compiled against.
  27. const _ = proto.ProtoPackageIsVersion1
  28. type Lease struct {
  29. ID int64 `protobuf:"varint,1,opt,name=ID,json=iD,proto3" json:"ID,omitempty"`
  30. TTL int64 `protobuf:"varint,2,opt,name=TTL,json=tTL,proto3" json:"TTL,omitempty"`
  31. }
  32. func (m *Lease) Reset() { *m = Lease{} }
  33. func (m *Lease) String() string { return proto.CompactTextString(m) }
  34. func (*Lease) ProtoMessage() {}
  35. func (*Lease) Descriptor() ([]byte, []int) { return fileDescriptorLease, []int{0} }
  36. type LeaseInternalRequest struct {
  37. LeaseTimeToLiveRequest *etcdserverpb.LeaseTimeToLiveRequest `protobuf:"bytes,1,opt,name=LeaseTimeToLiveRequest,json=leaseTimeToLiveRequest" json:"LeaseTimeToLiveRequest,omitempty"`
  38. }
  39. func (m *LeaseInternalRequest) Reset() { *m = LeaseInternalRequest{} }
  40. func (m *LeaseInternalRequest) String() string { return proto.CompactTextString(m) }
  41. func (*LeaseInternalRequest) ProtoMessage() {}
  42. func (*LeaseInternalRequest) Descriptor() ([]byte, []int) { return fileDescriptorLease, []int{1} }
  43. type LeaseInternalResponse struct {
  44. LeaseTimeToLiveResponse *etcdserverpb.LeaseTimeToLiveResponse `protobuf:"bytes,1,opt,name=LeaseTimeToLiveResponse,json=leaseTimeToLiveResponse" json:"LeaseTimeToLiveResponse,omitempty"`
  45. }
  46. func (m *LeaseInternalResponse) Reset() { *m = LeaseInternalResponse{} }
  47. func (m *LeaseInternalResponse) String() string { return proto.CompactTextString(m) }
  48. func (*LeaseInternalResponse) ProtoMessage() {}
  49. func (*LeaseInternalResponse) Descriptor() ([]byte, []int) { return fileDescriptorLease, []int{2} }
  50. func init() {
  51. proto.RegisterType((*Lease)(nil), "leasepb.Lease")
  52. proto.RegisterType((*LeaseInternalRequest)(nil), "leasepb.LeaseInternalRequest")
  53. proto.RegisterType((*LeaseInternalResponse)(nil), "leasepb.LeaseInternalResponse")
  54. }
  55. func (m *Lease) Marshal() (data []byte, err error) {
  56. size := m.Size()
  57. data = make([]byte, size)
  58. n, err := m.MarshalTo(data)
  59. if err != nil {
  60. return nil, err
  61. }
  62. return data[:n], nil
  63. }
  64. func (m *Lease) MarshalTo(data []byte) (int, error) {
  65. var i int
  66. _ = i
  67. var l int
  68. _ = l
  69. if m.ID != 0 {
  70. data[i] = 0x8
  71. i++
  72. i = encodeVarintLease(data, i, uint64(m.ID))
  73. }
  74. if m.TTL != 0 {
  75. data[i] = 0x10
  76. i++
  77. i = encodeVarintLease(data, i, uint64(m.TTL))
  78. }
  79. return i, nil
  80. }
  81. func (m *LeaseInternalRequest) Marshal() (data []byte, err error) {
  82. size := m.Size()
  83. data = make([]byte, size)
  84. n, err := m.MarshalTo(data)
  85. if err != nil {
  86. return nil, err
  87. }
  88. return data[:n], nil
  89. }
  90. func (m *LeaseInternalRequest) MarshalTo(data []byte) (int, error) {
  91. var i int
  92. _ = i
  93. var l int
  94. _ = l
  95. if m.LeaseTimeToLiveRequest != nil {
  96. data[i] = 0xa
  97. i++
  98. i = encodeVarintLease(data, i, uint64(m.LeaseTimeToLiveRequest.Size()))
  99. n1, err := m.LeaseTimeToLiveRequest.MarshalTo(data[i:])
  100. if err != nil {
  101. return 0, err
  102. }
  103. i += n1
  104. }
  105. return i, nil
  106. }
  107. func (m *LeaseInternalResponse) Marshal() (data []byte, err error) {
  108. size := m.Size()
  109. data = make([]byte, size)
  110. n, err := m.MarshalTo(data)
  111. if err != nil {
  112. return nil, err
  113. }
  114. return data[:n], nil
  115. }
  116. func (m *LeaseInternalResponse) MarshalTo(data []byte) (int, error) {
  117. var i int
  118. _ = i
  119. var l int
  120. _ = l
  121. if m.LeaseTimeToLiveResponse != nil {
  122. data[i] = 0xa
  123. i++
  124. i = encodeVarintLease(data, i, uint64(m.LeaseTimeToLiveResponse.Size()))
  125. n2, err := m.LeaseTimeToLiveResponse.MarshalTo(data[i:])
  126. if err != nil {
  127. return 0, err
  128. }
  129. i += n2
  130. }
  131. return i, nil
  132. }
  133. func encodeFixed64Lease(data []byte, offset int, v uint64) int {
  134. data[offset] = uint8(v)
  135. data[offset+1] = uint8(v >> 8)
  136. data[offset+2] = uint8(v >> 16)
  137. data[offset+3] = uint8(v >> 24)
  138. data[offset+4] = uint8(v >> 32)
  139. data[offset+5] = uint8(v >> 40)
  140. data[offset+6] = uint8(v >> 48)
  141. data[offset+7] = uint8(v >> 56)
  142. return offset + 8
  143. }
  144. func encodeFixed32Lease(data []byte, offset int, v uint32) int {
  145. data[offset] = uint8(v)
  146. data[offset+1] = uint8(v >> 8)
  147. data[offset+2] = uint8(v >> 16)
  148. data[offset+3] = uint8(v >> 24)
  149. return offset + 4
  150. }
  151. func encodeVarintLease(data []byte, offset int, v uint64) int {
  152. for v >= 1<<7 {
  153. data[offset] = uint8(v&0x7f | 0x80)
  154. v >>= 7
  155. offset++
  156. }
  157. data[offset] = uint8(v)
  158. return offset + 1
  159. }
  160. func (m *Lease) Size() (n int) {
  161. var l int
  162. _ = l
  163. if m.ID != 0 {
  164. n += 1 + sovLease(uint64(m.ID))
  165. }
  166. if m.TTL != 0 {
  167. n += 1 + sovLease(uint64(m.TTL))
  168. }
  169. return n
  170. }
  171. func (m *LeaseInternalRequest) Size() (n int) {
  172. var l int
  173. _ = l
  174. if m.LeaseTimeToLiveRequest != nil {
  175. l = m.LeaseTimeToLiveRequest.Size()
  176. n += 1 + l + sovLease(uint64(l))
  177. }
  178. return n
  179. }
  180. func (m *LeaseInternalResponse) Size() (n int) {
  181. var l int
  182. _ = l
  183. if m.LeaseTimeToLiveResponse != nil {
  184. l = m.LeaseTimeToLiveResponse.Size()
  185. n += 1 + l + sovLease(uint64(l))
  186. }
  187. return n
  188. }
  189. func sovLease(x uint64) (n int) {
  190. for {
  191. n++
  192. x >>= 7
  193. if x == 0 {
  194. break
  195. }
  196. }
  197. return n
  198. }
  199. func sozLease(x uint64) (n int) {
  200. return sovLease(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  201. }
  202. func (m *Lease) Unmarshal(data []byte) error {
  203. l := len(data)
  204. iNdEx := 0
  205. for iNdEx < l {
  206. preIndex := iNdEx
  207. var wire uint64
  208. for shift := uint(0); ; shift += 7 {
  209. if shift >= 64 {
  210. return ErrIntOverflowLease
  211. }
  212. if iNdEx >= l {
  213. return io.ErrUnexpectedEOF
  214. }
  215. b := data[iNdEx]
  216. iNdEx++
  217. wire |= (uint64(b) & 0x7F) << shift
  218. if b < 0x80 {
  219. break
  220. }
  221. }
  222. fieldNum := int32(wire >> 3)
  223. wireType := int(wire & 0x7)
  224. if wireType == 4 {
  225. return fmt.Errorf("proto: Lease: wiretype end group for non-group")
  226. }
  227. if fieldNum <= 0 {
  228. return fmt.Errorf("proto: Lease: illegal tag %d (wire type %d)", fieldNum, wire)
  229. }
  230. switch fieldNum {
  231. case 1:
  232. if wireType != 0 {
  233. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  234. }
  235. m.ID = 0
  236. for shift := uint(0); ; shift += 7 {
  237. if shift >= 64 {
  238. return ErrIntOverflowLease
  239. }
  240. if iNdEx >= l {
  241. return io.ErrUnexpectedEOF
  242. }
  243. b := data[iNdEx]
  244. iNdEx++
  245. m.ID |= (int64(b) & 0x7F) << shift
  246. if b < 0x80 {
  247. break
  248. }
  249. }
  250. case 2:
  251. if wireType != 0 {
  252. return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType)
  253. }
  254. m.TTL = 0
  255. for shift := uint(0); ; shift += 7 {
  256. if shift >= 64 {
  257. return ErrIntOverflowLease
  258. }
  259. if iNdEx >= l {
  260. return io.ErrUnexpectedEOF
  261. }
  262. b := data[iNdEx]
  263. iNdEx++
  264. m.TTL |= (int64(b) & 0x7F) << shift
  265. if b < 0x80 {
  266. break
  267. }
  268. }
  269. default:
  270. iNdEx = preIndex
  271. skippy, err := skipLease(data[iNdEx:])
  272. if err != nil {
  273. return err
  274. }
  275. if skippy < 0 {
  276. return ErrInvalidLengthLease
  277. }
  278. if (iNdEx + skippy) > l {
  279. return io.ErrUnexpectedEOF
  280. }
  281. iNdEx += skippy
  282. }
  283. }
  284. if iNdEx > l {
  285. return io.ErrUnexpectedEOF
  286. }
  287. return nil
  288. }
  289. func (m *LeaseInternalRequest) Unmarshal(data []byte) error {
  290. l := len(data)
  291. iNdEx := 0
  292. for iNdEx < l {
  293. preIndex := iNdEx
  294. var wire uint64
  295. for shift := uint(0); ; shift += 7 {
  296. if shift >= 64 {
  297. return ErrIntOverflowLease
  298. }
  299. if iNdEx >= l {
  300. return io.ErrUnexpectedEOF
  301. }
  302. b := data[iNdEx]
  303. iNdEx++
  304. wire |= (uint64(b) & 0x7F) << shift
  305. if b < 0x80 {
  306. break
  307. }
  308. }
  309. fieldNum := int32(wire >> 3)
  310. wireType := int(wire & 0x7)
  311. if wireType == 4 {
  312. return fmt.Errorf("proto: LeaseInternalRequest: wiretype end group for non-group")
  313. }
  314. if fieldNum <= 0 {
  315. return fmt.Errorf("proto: LeaseInternalRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  316. }
  317. switch fieldNum {
  318. case 1:
  319. if wireType != 2 {
  320. return fmt.Errorf("proto: wrong wireType = %d for field LeaseTimeToLiveRequest", wireType)
  321. }
  322. var msglen int
  323. for shift := uint(0); ; shift += 7 {
  324. if shift >= 64 {
  325. return ErrIntOverflowLease
  326. }
  327. if iNdEx >= l {
  328. return io.ErrUnexpectedEOF
  329. }
  330. b := data[iNdEx]
  331. iNdEx++
  332. msglen |= (int(b) & 0x7F) << shift
  333. if b < 0x80 {
  334. break
  335. }
  336. }
  337. if msglen < 0 {
  338. return ErrInvalidLengthLease
  339. }
  340. postIndex := iNdEx + msglen
  341. if postIndex > l {
  342. return io.ErrUnexpectedEOF
  343. }
  344. if m.LeaseTimeToLiveRequest == nil {
  345. m.LeaseTimeToLiveRequest = &etcdserverpb.LeaseTimeToLiveRequest{}
  346. }
  347. if err := m.LeaseTimeToLiveRequest.Unmarshal(data[iNdEx:postIndex]); err != nil {
  348. return err
  349. }
  350. iNdEx = postIndex
  351. default:
  352. iNdEx = preIndex
  353. skippy, err := skipLease(data[iNdEx:])
  354. if err != nil {
  355. return err
  356. }
  357. if skippy < 0 {
  358. return ErrInvalidLengthLease
  359. }
  360. if (iNdEx + skippy) > l {
  361. return io.ErrUnexpectedEOF
  362. }
  363. iNdEx += skippy
  364. }
  365. }
  366. if iNdEx > l {
  367. return io.ErrUnexpectedEOF
  368. }
  369. return nil
  370. }
  371. func (m *LeaseInternalResponse) Unmarshal(data []byte) error {
  372. l := len(data)
  373. iNdEx := 0
  374. for iNdEx < l {
  375. preIndex := iNdEx
  376. var wire uint64
  377. for shift := uint(0); ; shift += 7 {
  378. if shift >= 64 {
  379. return ErrIntOverflowLease
  380. }
  381. if iNdEx >= l {
  382. return io.ErrUnexpectedEOF
  383. }
  384. b := data[iNdEx]
  385. iNdEx++
  386. wire |= (uint64(b) & 0x7F) << shift
  387. if b < 0x80 {
  388. break
  389. }
  390. }
  391. fieldNum := int32(wire >> 3)
  392. wireType := int(wire & 0x7)
  393. if wireType == 4 {
  394. return fmt.Errorf("proto: LeaseInternalResponse: wiretype end group for non-group")
  395. }
  396. if fieldNum <= 0 {
  397. return fmt.Errorf("proto: LeaseInternalResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  398. }
  399. switch fieldNum {
  400. case 1:
  401. if wireType != 2 {
  402. return fmt.Errorf("proto: wrong wireType = %d for field LeaseTimeToLiveResponse", wireType)
  403. }
  404. var msglen int
  405. for shift := uint(0); ; shift += 7 {
  406. if shift >= 64 {
  407. return ErrIntOverflowLease
  408. }
  409. if iNdEx >= l {
  410. return io.ErrUnexpectedEOF
  411. }
  412. b := data[iNdEx]
  413. iNdEx++
  414. msglen |= (int(b) & 0x7F) << shift
  415. if b < 0x80 {
  416. break
  417. }
  418. }
  419. if msglen < 0 {
  420. return ErrInvalidLengthLease
  421. }
  422. postIndex := iNdEx + msglen
  423. if postIndex > l {
  424. return io.ErrUnexpectedEOF
  425. }
  426. if m.LeaseTimeToLiveResponse == nil {
  427. m.LeaseTimeToLiveResponse = &etcdserverpb.LeaseTimeToLiveResponse{}
  428. }
  429. if err := m.LeaseTimeToLiveResponse.Unmarshal(data[iNdEx:postIndex]); err != nil {
  430. return err
  431. }
  432. iNdEx = postIndex
  433. default:
  434. iNdEx = preIndex
  435. skippy, err := skipLease(data[iNdEx:])
  436. if err != nil {
  437. return err
  438. }
  439. if skippy < 0 {
  440. return ErrInvalidLengthLease
  441. }
  442. if (iNdEx + skippy) > l {
  443. return io.ErrUnexpectedEOF
  444. }
  445. iNdEx += skippy
  446. }
  447. }
  448. if iNdEx > l {
  449. return io.ErrUnexpectedEOF
  450. }
  451. return nil
  452. }
  453. func skipLease(data []byte) (n int, err error) {
  454. l := len(data)
  455. iNdEx := 0
  456. for iNdEx < l {
  457. var wire uint64
  458. for shift := uint(0); ; shift += 7 {
  459. if shift >= 64 {
  460. return 0, ErrIntOverflowLease
  461. }
  462. if iNdEx >= l {
  463. return 0, io.ErrUnexpectedEOF
  464. }
  465. b := data[iNdEx]
  466. iNdEx++
  467. wire |= (uint64(b) & 0x7F) << shift
  468. if b < 0x80 {
  469. break
  470. }
  471. }
  472. wireType := int(wire & 0x7)
  473. switch wireType {
  474. case 0:
  475. for shift := uint(0); ; shift += 7 {
  476. if shift >= 64 {
  477. return 0, ErrIntOverflowLease
  478. }
  479. if iNdEx >= l {
  480. return 0, io.ErrUnexpectedEOF
  481. }
  482. iNdEx++
  483. if data[iNdEx-1] < 0x80 {
  484. break
  485. }
  486. }
  487. return iNdEx, nil
  488. case 1:
  489. iNdEx += 8
  490. return iNdEx, nil
  491. case 2:
  492. var length int
  493. for shift := uint(0); ; shift += 7 {
  494. if shift >= 64 {
  495. return 0, ErrIntOverflowLease
  496. }
  497. if iNdEx >= l {
  498. return 0, io.ErrUnexpectedEOF
  499. }
  500. b := data[iNdEx]
  501. iNdEx++
  502. length |= (int(b) & 0x7F) << shift
  503. if b < 0x80 {
  504. break
  505. }
  506. }
  507. iNdEx += length
  508. if length < 0 {
  509. return 0, ErrInvalidLengthLease
  510. }
  511. return iNdEx, nil
  512. case 3:
  513. for {
  514. var innerWire uint64
  515. var start int = iNdEx
  516. for shift := uint(0); ; shift += 7 {
  517. if shift >= 64 {
  518. return 0, ErrIntOverflowLease
  519. }
  520. if iNdEx >= l {
  521. return 0, io.ErrUnexpectedEOF
  522. }
  523. b := data[iNdEx]
  524. iNdEx++
  525. innerWire |= (uint64(b) & 0x7F) << shift
  526. if b < 0x80 {
  527. break
  528. }
  529. }
  530. innerWireType := int(innerWire & 0x7)
  531. if innerWireType == 4 {
  532. break
  533. }
  534. next, err := skipLease(data[start:])
  535. if err != nil {
  536. return 0, err
  537. }
  538. iNdEx = start + next
  539. }
  540. return iNdEx, nil
  541. case 4:
  542. return iNdEx, nil
  543. case 5:
  544. iNdEx += 4
  545. return iNdEx, nil
  546. default:
  547. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  548. }
  549. }
  550. panic("unreachable")
  551. }
  552. var (
  553. ErrInvalidLengthLease = fmt.Errorf("proto: negative length found during unmarshaling")
  554. ErrIntOverflowLease = fmt.Errorf("proto: integer overflow")
  555. )
  556. var fileDescriptorLease = []byte{
  557. // 239 bytes of a gzipped FileDescriptorProto
  558. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x49, 0x4d, 0x2c,
  559. 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x07, 0x73, 0x0a, 0x92, 0xa4, 0x44, 0xd2,
  560. 0xf3, 0xd3, 0xf3, 0xc1, 0x62, 0xfa, 0x20, 0x16, 0x44, 0x5a, 0x4a, 0x2d, 0xb5, 0x24, 0x39, 0x45,
  561. 0x1f, 0x44, 0x14, 0xa7, 0x16, 0x95, 0xa5, 0x16, 0x21, 0x31, 0x0b, 0x92, 0xf4, 0x8b, 0x0a, 0x92,
  562. 0x21, 0xea, 0x94, 0x34, 0xb9, 0x58, 0x7d, 0x40, 0x06, 0x09, 0xf1, 0x71, 0x31, 0x79, 0xba, 0x48,
  563. 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0x31, 0x65, 0xba, 0x08, 0x09, 0x70, 0x31, 0x87, 0x84, 0xf8,
  564. 0x48, 0x30, 0x81, 0x05, 0x98, 0x4b, 0x42, 0x7c, 0x94, 0x4a, 0xb8, 0x44, 0xc0, 0x4a, 0x3d, 0xf3,
  565. 0x4a, 0x52, 0x8b, 0xf2, 0x12, 0x73, 0x82, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x62, 0xb8,
  566. 0xc4, 0xc0, 0xe2, 0x21, 0x99, 0xb9, 0xa9, 0x21, 0xf9, 0x3e, 0x99, 0x65, 0xa9, 0x50, 0x19, 0xb0,
  567. 0x69, 0xdc, 0x46, 0x2a, 0x7a, 0xc8, 0x76, 0xeb, 0x61, 0x57, 0x1b, 0x24, 0x96, 0x83, 0x55, 0x5c,
  568. 0xa9, 0x82, 0x4b, 0x14, 0xcd, 0xd6, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa1, 0x78, 0x2e, 0x71,
  569. 0x0c, 0xa3, 0x20, 0x52, 0x50, 0x7b, 0x55, 0x09, 0xd8, 0x0b, 0x51, 0x1c, 0x24, 0x9e, 0x83, 0x5d,
  570. 0xc2, 0x49, 0xe2, 0xc4, 0x43, 0x39, 0x86, 0x0b, 0x0f, 0xe5, 0x18, 0x4e, 0x3c, 0x92, 0x63, 0xbc,
  571. 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x19, 0x8f, 0xe5, 0x18, 0x92, 0xd8, 0xc0, 0x61,
  572. 0x67, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x65, 0xaa, 0x74, 0x2e, 0x91, 0x01, 0x00, 0x00,
  573. }