lease.pb.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: lease.proto
  3. package leasepb
  4. import (
  5. fmt "fmt"
  6. io "io"
  7. math "math"
  8. math_bits "math/bits"
  9. etcdserverpb "github.com/coreos/etcd/etcdserver/etcdserverpb"
  10. _ "github.com/gogo/protobuf/gogoproto"
  11. proto "github.com/golang/protobuf/proto"
  12. )
  13. // Reference imports to suppress errors if they are not otherwise used.
  14. var _ = proto.Marshal
  15. var _ = fmt.Errorf
  16. var _ = math.Inf
  17. // This is a compile-time assertion to ensure that this generated file
  18. // is compatible with the proto package it is being compiled against.
  19. // A compilation error at this line likely means your copy of the
  20. // proto package needs to be updated.
  21. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  22. type Lease struct {
  23. ID int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
  24. TTL int64 `protobuf:"varint,2,opt,name=TTL,proto3" json:"TTL,omitempty"`
  25. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  26. XXX_unrecognized []byte `json:"-"`
  27. XXX_sizecache int32 `json:"-"`
  28. }
  29. func (m *Lease) Reset() { *m = Lease{} }
  30. func (m *Lease) String() string { return proto.CompactTextString(m) }
  31. func (*Lease) ProtoMessage() {}
  32. func (*Lease) Descriptor() ([]byte, []int) {
  33. return fileDescriptor_3dd57e402472b33a, []int{0}
  34. }
  35. func (m *Lease) XXX_Unmarshal(b []byte) error {
  36. return m.Unmarshal(b)
  37. }
  38. func (m *Lease) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  39. if deterministic {
  40. return xxx_messageInfo_Lease.Marshal(b, m, deterministic)
  41. } else {
  42. b = b[:cap(b)]
  43. n, err := m.MarshalToSizedBuffer(b)
  44. if err != nil {
  45. return nil, err
  46. }
  47. return b[:n], nil
  48. }
  49. }
  50. func (m *Lease) XXX_Merge(src proto.Message) {
  51. xxx_messageInfo_Lease.Merge(m, src)
  52. }
  53. func (m *Lease) XXX_Size() int {
  54. return m.Size()
  55. }
  56. func (m *Lease) XXX_DiscardUnknown() {
  57. xxx_messageInfo_Lease.DiscardUnknown(m)
  58. }
  59. var xxx_messageInfo_Lease proto.InternalMessageInfo
  60. type LeaseInternalRequest struct {
  61. LeaseTimeToLiveRequest *etcdserverpb.LeaseTimeToLiveRequest `protobuf:"bytes,1,opt,name=LeaseTimeToLiveRequest,proto3" json:"LeaseTimeToLiveRequest,omitempty"`
  62. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  63. XXX_unrecognized []byte `json:"-"`
  64. XXX_sizecache int32 `json:"-"`
  65. }
  66. func (m *LeaseInternalRequest) Reset() { *m = LeaseInternalRequest{} }
  67. func (m *LeaseInternalRequest) String() string { return proto.CompactTextString(m) }
  68. func (*LeaseInternalRequest) ProtoMessage() {}
  69. func (*LeaseInternalRequest) Descriptor() ([]byte, []int) {
  70. return fileDescriptor_3dd57e402472b33a, []int{1}
  71. }
  72. func (m *LeaseInternalRequest) XXX_Unmarshal(b []byte) error {
  73. return m.Unmarshal(b)
  74. }
  75. func (m *LeaseInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  76. if deterministic {
  77. return xxx_messageInfo_LeaseInternalRequest.Marshal(b, m, deterministic)
  78. } else {
  79. b = b[:cap(b)]
  80. n, err := m.MarshalToSizedBuffer(b)
  81. if err != nil {
  82. return nil, err
  83. }
  84. return b[:n], nil
  85. }
  86. }
  87. func (m *LeaseInternalRequest) XXX_Merge(src proto.Message) {
  88. xxx_messageInfo_LeaseInternalRequest.Merge(m, src)
  89. }
  90. func (m *LeaseInternalRequest) XXX_Size() int {
  91. return m.Size()
  92. }
  93. func (m *LeaseInternalRequest) XXX_DiscardUnknown() {
  94. xxx_messageInfo_LeaseInternalRequest.DiscardUnknown(m)
  95. }
  96. var xxx_messageInfo_LeaseInternalRequest proto.InternalMessageInfo
  97. type LeaseInternalResponse struct {
  98. LeaseTimeToLiveResponse *etcdserverpb.LeaseTimeToLiveResponse `protobuf:"bytes,1,opt,name=LeaseTimeToLiveResponse,proto3" json:"LeaseTimeToLiveResponse,omitempty"`
  99. XXX_NoUnkeyedLiteral struct{} `json:"-"`
  100. XXX_unrecognized []byte `json:"-"`
  101. XXX_sizecache int32 `json:"-"`
  102. }
  103. func (m *LeaseInternalResponse) Reset() { *m = LeaseInternalResponse{} }
  104. func (m *LeaseInternalResponse) String() string { return proto.CompactTextString(m) }
  105. func (*LeaseInternalResponse) ProtoMessage() {}
  106. func (*LeaseInternalResponse) Descriptor() ([]byte, []int) {
  107. return fileDescriptor_3dd57e402472b33a, []int{2}
  108. }
  109. func (m *LeaseInternalResponse) XXX_Unmarshal(b []byte) error {
  110. return m.Unmarshal(b)
  111. }
  112. func (m *LeaseInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
  113. if deterministic {
  114. return xxx_messageInfo_LeaseInternalResponse.Marshal(b, m, deterministic)
  115. } else {
  116. b = b[:cap(b)]
  117. n, err := m.MarshalToSizedBuffer(b)
  118. if err != nil {
  119. return nil, err
  120. }
  121. return b[:n], nil
  122. }
  123. }
  124. func (m *LeaseInternalResponse) XXX_Merge(src proto.Message) {
  125. xxx_messageInfo_LeaseInternalResponse.Merge(m, src)
  126. }
  127. func (m *LeaseInternalResponse) XXX_Size() int {
  128. return m.Size()
  129. }
  130. func (m *LeaseInternalResponse) XXX_DiscardUnknown() {
  131. xxx_messageInfo_LeaseInternalResponse.DiscardUnknown(m)
  132. }
  133. var xxx_messageInfo_LeaseInternalResponse proto.InternalMessageInfo
  134. func init() {
  135. proto.RegisterType((*Lease)(nil), "leasepb.Lease")
  136. proto.RegisterType((*LeaseInternalRequest)(nil), "leasepb.LeaseInternalRequest")
  137. proto.RegisterType((*LeaseInternalResponse)(nil), "leasepb.LeaseInternalResponse")
  138. }
  139. func init() { proto.RegisterFile("lease.proto", fileDescriptor_3dd57e402472b33a) }
  140. var fileDescriptor_3dd57e402472b33a = []byte{
  141. // 233 bytes of a gzipped FileDescriptorProto
  142. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x49, 0x4d, 0x2c,
  143. 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x07, 0x73, 0x0a, 0x92, 0xa4, 0x44, 0xd2,
  144. 0xf3, 0xd3, 0xf3, 0xc1, 0x62, 0xfa, 0x20, 0x16, 0x44, 0x5a, 0x4a, 0x2d, 0xb5, 0x24, 0x39, 0x45,
  145. 0x1f, 0x44, 0x14, 0xa7, 0x16, 0x95, 0xa5, 0x16, 0x21, 0x31, 0x0b, 0x92, 0xf4, 0x8b, 0x0a, 0x92,
  146. 0x21, 0xea, 0x94, 0x34, 0xb9, 0x58, 0x7d, 0x40, 0x06, 0x09, 0xf1, 0x71, 0x31, 0x79, 0xba, 0x48,
  147. 0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0x31, 0x79, 0xba, 0x08, 0x09, 0x70, 0x31, 0x87, 0x84, 0xf8,
  148. 0x48, 0x30, 0x81, 0x05, 0x40, 0x4c, 0xa5, 0x12, 0x2e, 0x11, 0xb0, 0x52, 0xcf, 0xbc, 0x92, 0xd4,
  149. 0xa2, 0xbc, 0xc4, 0x9c, 0xa0, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x12, 0xa1, 0x18, 0x2e, 0x31, 0xb0,
  150. 0x78, 0x48, 0x66, 0x6e, 0x6a, 0x48, 0xbe, 0x4f, 0x66, 0x59, 0x2a, 0x54, 0x06, 0x6c, 0x1a, 0xb7,
  151. 0x91, 0x8a, 0x1e, 0xb2, 0xdd, 0x7a, 0xd8, 0xd5, 0x06, 0xe1, 0x30, 0x43, 0xa9, 0x82, 0x4b, 0x14,
  152. 0xcd, 0xd6, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa1, 0x78, 0x2e, 0x71, 0x0c, 0x2d, 0x10, 0x29,
  153. 0xa8, 0xbd, 0xaa, 0x04, 0xec, 0x85, 0x28, 0x0e, 0xc2, 0x65, 0x8a, 0x93, 0xc4, 0x89, 0x87, 0x72,
  154. 0x0c, 0x17, 0x1e, 0xca, 0x31, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47,
  155. 0x72, 0x8c, 0x33, 0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81, 0xc3, 0xce, 0x18, 0x10, 0x00, 0x00, 0xff,
  156. 0xff, 0x9f, 0xf2, 0x42, 0xe0, 0x91, 0x01, 0x00, 0x00,
  157. }
  158. func (m *Lease) Marshal() (dAtA []byte, err error) {
  159. size := m.Size()
  160. dAtA = make([]byte, size)
  161. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  162. if err != nil {
  163. return nil, err
  164. }
  165. return dAtA[:n], nil
  166. }
  167. func (m *Lease) MarshalTo(dAtA []byte) (int, error) {
  168. size := m.Size()
  169. return m.MarshalToSizedBuffer(dAtA[:size])
  170. }
  171. func (m *Lease) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  172. i := len(dAtA)
  173. _ = i
  174. var l int
  175. _ = l
  176. if m.XXX_unrecognized != nil {
  177. i -= len(m.XXX_unrecognized)
  178. copy(dAtA[i:], m.XXX_unrecognized)
  179. }
  180. if m.TTL != 0 {
  181. i = encodeVarintLease(dAtA, i, uint64(m.TTL))
  182. i--
  183. dAtA[i] = 0x10
  184. }
  185. if m.ID != 0 {
  186. i = encodeVarintLease(dAtA, i, uint64(m.ID))
  187. i--
  188. dAtA[i] = 0x8
  189. }
  190. return len(dAtA) - i, nil
  191. }
  192. func (m *LeaseInternalRequest) Marshal() (dAtA []byte, err error) {
  193. size := m.Size()
  194. dAtA = make([]byte, size)
  195. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  196. if err != nil {
  197. return nil, err
  198. }
  199. return dAtA[:n], nil
  200. }
  201. func (m *LeaseInternalRequest) MarshalTo(dAtA []byte) (int, error) {
  202. size := m.Size()
  203. return m.MarshalToSizedBuffer(dAtA[:size])
  204. }
  205. func (m *LeaseInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  206. i := len(dAtA)
  207. _ = i
  208. var l int
  209. _ = l
  210. if m.XXX_unrecognized != nil {
  211. i -= len(m.XXX_unrecognized)
  212. copy(dAtA[i:], m.XXX_unrecognized)
  213. }
  214. if m.LeaseTimeToLiveRequest != nil {
  215. {
  216. size, err := m.LeaseTimeToLiveRequest.MarshalToSizedBuffer(dAtA[:i])
  217. if err != nil {
  218. return 0, err
  219. }
  220. i -= size
  221. i = encodeVarintLease(dAtA, i, uint64(size))
  222. }
  223. i--
  224. dAtA[i] = 0xa
  225. }
  226. return len(dAtA) - i, nil
  227. }
  228. func (m *LeaseInternalResponse) Marshal() (dAtA []byte, err error) {
  229. size := m.Size()
  230. dAtA = make([]byte, size)
  231. n, err := m.MarshalToSizedBuffer(dAtA[:size])
  232. if err != nil {
  233. return nil, err
  234. }
  235. return dAtA[:n], nil
  236. }
  237. func (m *LeaseInternalResponse) MarshalTo(dAtA []byte) (int, error) {
  238. size := m.Size()
  239. return m.MarshalToSizedBuffer(dAtA[:size])
  240. }
  241. func (m *LeaseInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
  242. i := len(dAtA)
  243. _ = i
  244. var l int
  245. _ = l
  246. if m.XXX_unrecognized != nil {
  247. i -= len(m.XXX_unrecognized)
  248. copy(dAtA[i:], m.XXX_unrecognized)
  249. }
  250. if m.LeaseTimeToLiveResponse != nil {
  251. {
  252. size, err := m.LeaseTimeToLiveResponse.MarshalToSizedBuffer(dAtA[:i])
  253. if err != nil {
  254. return 0, err
  255. }
  256. i -= size
  257. i = encodeVarintLease(dAtA, i, uint64(size))
  258. }
  259. i--
  260. dAtA[i] = 0xa
  261. }
  262. return len(dAtA) - i, nil
  263. }
  264. func encodeVarintLease(dAtA []byte, offset int, v uint64) int {
  265. offset -= sovLease(v)
  266. base := offset
  267. for v >= 1<<7 {
  268. dAtA[offset] = uint8(v&0x7f | 0x80)
  269. v >>= 7
  270. offset++
  271. }
  272. dAtA[offset] = uint8(v)
  273. return base
  274. }
  275. func (m *Lease) Size() (n int) {
  276. if m == nil {
  277. return 0
  278. }
  279. var l int
  280. _ = l
  281. if m.ID != 0 {
  282. n += 1 + sovLease(uint64(m.ID))
  283. }
  284. if m.TTL != 0 {
  285. n += 1 + sovLease(uint64(m.TTL))
  286. }
  287. if m.XXX_unrecognized != nil {
  288. n += len(m.XXX_unrecognized)
  289. }
  290. return n
  291. }
  292. func (m *LeaseInternalRequest) Size() (n int) {
  293. if m == nil {
  294. return 0
  295. }
  296. var l int
  297. _ = l
  298. if m.LeaseTimeToLiveRequest != nil {
  299. l = m.LeaseTimeToLiveRequest.Size()
  300. n += 1 + l + sovLease(uint64(l))
  301. }
  302. if m.XXX_unrecognized != nil {
  303. n += len(m.XXX_unrecognized)
  304. }
  305. return n
  306. }
  307. func (m *LeaseInternalResponse) Size() (n int) {
  308. if m == nil {
  309. return 0
  310. }
  311. var l int
  312. _ = l
  313. if m.LeaseTimeToLiveResponse != nil {
  314. l = m.LeaseTimeToLiveResponse.Size()
  315. n += 1 + l + sovLease(uint64(l))
  316. }
  317. if m.XXX_unrecognized != nil {
  318. n += len(m.XXX_unrecognized)
  319. }
  320. return n
  321. }
  322. func sovLease(x uint64) (n int) {
  323. return (math_bits.Len64(x|1) + 6) / 7
  324. }
  325. func sozLease(x uint64) (n int) {
  326. return sovLease(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  327. }
  328. func (m *Lease) Unmarshal(dAtA []byte) error {
  329. l := len(dAtA)
  330. iNdEx := 0
  331. for iNdEx < l {
  332. preIndex := iNdEx
  333. var wire uint64
  334. for shift := uint(0); ; shift += 7 {
  335. if shift >= 64 {
  336. return ErrIntOverflowLease
  337. }
  338. if iNdEx >= l {
  339. return io.ErrUnexpectedEOF
  340. }
  341. b := dAtA[iNdEx]
  342. iNdEx++
  343. wire |= uint64(b&0x7F) << shift
  344. if b < 0x80 {
  345. break
  346. }
  347. }
  348. fieldNum := int32(wire >> 3)
  349. wireType := int(wire & 0x7)
  350. if wireType == 4 {
  351. return fmt.Errorf("proto: Lease: wiretype end group for non-group")
  352. }
  353. if fieldNum <= 0 {
  354. return fmt.Errorf("proto: Lease: illegal tag %d (wire type %d)", fieldNum, wire)
  355. }
  356. switch fieldNum {
  357. case 1:
  358. if wireType != 0 {
  359. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  360. }
  361. m.ID = 0
  362. for shift := uint(0); ; shift += 7 {
  363. if shift >= 64 {
  364. return ErrIntOverflowLease
  365. }
  366. if iNdEx >= l {
  367. return io.ErrUnexpectedEOF
  368. }
  369. b := dAtA[iNdEx]
  370. iNdEx++
  371. m.ID |= int64(b&0x7F) << shift
  372. if b < 0x80 {
  373. break
  374. }
  375. }
  376. case 2:
  377. if wireType != 0 {
  378. return fmt.Errorf("proto: wrong wireType = %d for field TTL", wireType)
  379. }
  380. m.TTL = 0
  381. for shift := uint(0); ; shift += 7 {
  382. if shift >= 64 {
  383. return ErrIntOverflowLease
  384. }
  385. if iNdEx >= l {
  386. return io.ErrUnexpectedEOF
  387. }
  388. b := dAtA[iNdEx]
  389. iNdEx++
  390. m.TTL |= int64(b&0x7F) << shift
  391. if b < 0x80 {
  392. break
  393. }
  394. }
  395. default:
  396. iNdEx = preIndex
  397. skippy, err := skipLease(dAtA[iNdEx:])
  398. if err != nil {
  399. return err
  400. }
  401. if skippy < 0 {
  402. return ErrInvalidLengthLease
  403. }
  404. if (iNdEx + skippy) < 0 {
  405. return ErrInvalidLengthLease
  406. }
  407. if (iNdEx + skippy) > l {
  408. return io.ErrUnexpectedEOF
  409. }
  410. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  411. iNdEx += skippy
  412. }
  413. }
  414. if iNdEx > l {
  415. return io.ErrUnexpectedEOF
  416. }
  417. return nil
  418. }
  419. func (m *LeaseInternalRequest) Unmarshal(dAtA []byte) error {
  420. l := len(dAtA)
  421. iNdEx := 0
  422. for iNdEx < l {
  423. preIndex := iNdEx
  424. var wire uint64
  425. for shift := uint(0); ; shift += 7 {
  426. if shift >= 64 {
  427. return ErrIntOverflowLease
  428. }
  429. if iNdEx >= l {
  430. return io.ErrUnexpectedEOF
  431. }
  432. b := dAtA[iNdEx]
  433. iNdEx++
  434. wire |= uint64(b&0x7F) << shift
  435. if b < 0x80 {
  436. break
  437. }
  438. }
  439. fieldNum := int32(wire >> 3)
  440. wireType := int(wire & 0x7)
  441. if wireType == 4 {
  442. return fmt.Errorf("proto: LeaseInternalRequest: wiretype end group for non-group")
  443. }
  444. if fieldNum <= 0 {
  445. return fmt.Errorf("proto: LeaseInternalRequest: illegal tag %d (wire type %d)", fieldNum, wire)
  446. }
  447. switch fieldNum {
  448. case 1:
  449. if wireType != 2 {
  450. return fmt.Errorf("proto: wrong wireType = %d for field LeaseTimeToLiveRequest", wireType)
  451. }
  452. var msglen int
  453. for shift := uint(0); ; shift += 7 {
  454. if shift >= 64 {
  455. return ErrIntOverflowLease
  456. }
  457. if iNdEx >= l {
  458. return io.ErrUnexpectedEOF
  459. }
  460. b := dAtA[iNdEx]
  461. iNdEx++
  462. msglen |= int(b&0x7F) << shift
  463. if b < 0x80 {
  464. break
  465. }
  466. }
  467. if msglen < 0 {
  468. return ErrInvalidLengthLease
  469. }
  470. postIndex := iNdEx + msglen
  471. if postIndex < 0 {
  472. return ErrInvalidLengthLease
  473. }
  474. if postIndex > l {
  475. return io.ErrUnexpectedEOF
  476. }
  477. if m.LeaseTimeToLiveRequest == nil {
  478. m.LeaseTimeToLiveRequest = &etcdserverpb.LeaseTimeToLiveRequest{}
  479. }
  480. if err := m.LeaseTimeToLiveRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  481. return err
  482. }
  483. iNdEx = postIndex
  484. default:
  485. iNdEx = preIndex
  486. skippy, err := skipLease(dAtA[iNdEx:])
  487. if err != nil {
  488. return err
  489. }
  490. if skippy < 0 {
  491. return ErrInvalidLengthLease
  492. }
  493. if (iNdEx + skippy) < 0 {
  494. return ErrInvalidLengthLease
  495. }
  496. if (iNdEx + skippy) > l {
  497. return io.ErrUnexpectedEOF
  498. }
  499. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  500. iNdEx += skippy
  501. }
  502. }
  503. if iNdEx > l {
  504. return io.ErrUnexpectedEOF
  505. }
  506. return nil
  507. }
  508. func (m *LeaseInternalResponse) Unmarshal(dAtA []byte) error {
  509. l := len(dAtA)
  510. iNdEx := 0
  511. for iNdEx < l {
  512. preIndex := iNdEx
  513. var wire uint64
  514. for shift := uint(0); ; shift += 7 {
  515. if shift >= 64 {
  516. return ErrIntOverflowLease
  517. }
  518. if iNdEx >= l {
  519. return io.ErrUnexpectedEOF
  520. }
  521. b := dAtA[iNdEx]
  522. iNdEx++
  523. wire |= uint64(b&0x7F) << shift
  524. if b < 0x80 {
  525. break
  526. }
  527. }
  528. fieldNum := int32(wire >> 3)
  529. wireType := int(wire & 0x7)
  530. if wireType == 4 {
  531. return fmt.Errorf("proto: LeaseInternalResponse: wiretype end group for non-group")
  532. }
  533. if fieldNum <= 0 {
  534. return fmt.Errorf("proto: LeaseInternalResponse: illegal tag %d (wire type %d)", fieldNum, wire)
  535. }
  536. switch fieldNum {
  537. case 1:
  538. if wireType != 2 {
  539. return fmt.Errorf("proto: wrong wireType = %d for field LeaseTimeToLiveResponse", wireType)
  540. }
  541. var msglen int
  542. for shift := uint(0); ; shift += 7 {
  543. if shift >= 64 {
  544. return ErrIntOverflowLease
  545. }
  546. if iNdEx >= l {
  547. return io.ErrUnexpectedEOF
  548. }
  549. b := dAtA[iNdEx]
  550. iNdEx++
  551. msglen |= int(b&0x7F) << shift
  552. if b < 0x80 {
  553. break
  554. }
  555. }
  556. if msglen < 0 {
  557. return ErrInvalidLengthLease
  558. }
  559. postIndex := iNdEx + msglen
  560. if postIndex < 0 {
  561. return ErrInvalidLengthLease
  562. }
  563. if postIndex > l {
  564. return io.ErrUnexpectedEOF
  565. }
  566. if m.LeaseTimeToLiveResponse == nil {
  567. m.LeaseTimeToLiveResponse = &etcdserverpb.LeaseTimeToLiveResponse{}
  568. }
  569. if err := m.LeaseTimeToLiveResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  570. return err
  571. }
  572. iNdEx = postIndex
  573. default:
  574. iNdEx = preIndex
  575. skippy, err := skipLease(dAtA[iNdEx:])
  576. if err != nil {
  577. return err
  578. }
  579. if skippy < 0 {
  580. return ErrInvalidLengthLease
  581. }
  582. if (iNdEx + skippy) < 0 {
  583. return ErrInvalidLengthLease
  584. }
  585. if (iNdEx + skippy) > l {
  586. return io.ErrUnexpectedEOF
  587. }
  588. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  589. iNdEx += skippy
  590. }
  591. }
  592. if iNdEx > l {
  593. return io.ErrUnexpectedEOF
  594. }
  595. return nil
  596. }
  597. func skipLease(dAtA []byte) (n int, err error) {
  598. l := len(dAtA)
  599. iNdEx := 0
  600. for iNdEx < l {
  601. var wire uint64
  602. for shift := uint(0); ; shift += 7 {
  603. if shift >= 64 {
  604. return 0, ErrIntOverflowLease
  605. }
  606. if iNdEx >= l {
  607. return 0, io.ErrUnexpectedEOF
  608. }
  609. b := dAtA[iNdEx]
  610. iNdEx++
  611. wire |= (uint64(b) & 0x7F) << shift
  612. if b < 0x80 {
  613. break
  614. }
  615. }
  616. wireType := int(wire & 0x7)
  617. switch wireType {
  618. case 0:
  619. for shift := uint(0); ; shift += 7 {
  620. if shift >= 64 {
  621. return 0, ErrIntOverflowLease
  622. }
  623. if iNdEx >= l {
  624. return 0, io.ErrUnexpectedEOF
  625. }
  626. iNdEx++
  627. if dAtA[iNdEx-1] < 0x80 {
  628. break
  629. }
  630. }
  631. return iNdEx, nil
  632. case 1:
  633. iNdEx += 8
  634. return iNdEx, nil
  635. case 2:
  636. var length int
  637. for shift := uint(0); ; shift += 7 {
  638. if shift >= 64 {
  639. return 0, ErrIntOverflowLease
  640. }
  641. if iNdEx >= l {
  642. return 0, io.ErrUnexpectedEOF
  643. }
  644. b := dAtA[iNdEx]
  645. iNdEx++
  646. length |= (int(b) & 0x7F) << shift
  647. if b < 0x80 {
  648. break
  649. }
  650. }
  651. if length < 0 {
  652. return 0, ErrInvalidLengthLease
  653. }
  654. iNdEx += length
  655. if iNdEx < 0 {
  656. return 0, ErrInvalidLengthLease
  657. }
  658. return iNdEx, nil
  659. case 3:
  660. for {
  661. var innerWire uint64
  662. var start int = iNdEx
  663. for shift := uint(0); ; shift += 7 {
  664. if shift >= 64 {
  665. return 0, ErrIntOverflowLease
  666. }
  667. if iNdEx >= l {
  668. return 0, io.ErrUnexpectedEOF
  669. }
  670. b := dAtA[iNdEx]
  671. iNdEx++
  672. innerWire |= (uint64(b) & 0x7F) << shift
  673. if b < 0x80 {
  674. break
  675. }
  676. }
  677. innerWireType := int(innerWire & 0x7)
  678. if innerWireType == 4 {
  679. break
  680. }
  681. next, err := skipLease(dAtA[start:])
  682. if err != nil {
  683. return 0, err
  684. }
  685. iNdEx = start + next
  686. if iNdEx < 0 {
  687. return 0, ErrInvalidLengthLease
  688. }
  689. }
  690. return iNdEx, nil
  691. case 4:
  692. return iNdEx, nil
  693. case 5:
  694. iNdEx += 4
  695. return iNdEx, nil
  696. default:
  697. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  698. }
  699. }
  700. panic("unreachable")
  701. }
  702. var (
  703. ErrInvalidLengthLease = fmt.Errorf("proto: negative length found during unmarshaling")
  704. ErrIntOverflowLease = fmt.Errorf("proto: integer overflow")
  705. )