Debian Codegraph @

vendor/github.com/coreos/etcd/lease/leasepb/lease.pb.go

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