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