lease.pb.go 14 KB

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