|
|
@@ -10,6 +10,8 @@
|
|
|
|
|
|
It has these top-level messages:
|
|
|
Lease
|
|
|
+ LeaseInternalRequest
|
|
|
+ LeaseInternalResponse
|
|
|
*/
|
|
|
package leasepb
|
|
|
|
|
|
@@ -19,9 +21,11 @@ import (
|
|
|
proto "github.com/golang/protobuf/proto"
|
|
|
|
|
|
math "math"
|
|
|
+
|
|
|
+ io "io"
|
|
|
)
|
|
|
|
|
|
-import io "io"
|
|
|
+import etcdserverpb "github.com/coreos/etcd/etcdserver/etcdserverpb"
|
|
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
|
var _ = proto.Marshal
|
|
|
@@ -42,8 +46,28 @@ func (m *Lease) String() string { return proto.CompactTextString(m) }
|
|
|
func (*Lease) ProtoMessage() {}
|
|
|
func (*Lease) Descriptor() ([]byte, []int) { return fileDescriptorLease, []int{0} }
|
|
|
|
|
|
+type LeaseInternalRequest struct {
|
|
|
+ LeaseTimeToLiveRequest *etcdserverpb.LeaseTimeToLiveRequest `protobuf:"bytes,1,opt,name=LeaseTimeToLiveRequest,json=leaseTimeToLiveRequest" json:"LeaseTimeToLiveRequest,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *LeaseInternalRequest) Reset() { *m = LeaseInternalRequest{} }
|
|
|
+func (m *LeaseInternalRequest) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*LeaseInternalRequest) ProtoMessage() {}
|
|
|
+func (*LeaseInternalRequest) Descriptor() ([]byte, []int) { return fileDescriptorLease, []int{1} }
|
|
|
+
|
|
|
+type LeaseInternalResponse struct {
|
|
|
+ LeaseTimeToLiveResponse *etcdserverpb.LeaseTimeToLiveResponse `protobuf:"bytes,1,opt,name=LeaseTimeToLiveResponse,json=leaseTimeToLiveResponse" json:"LeaseTimeToLiveResponse,omitempty"`
|
|
|
+}
|
|
|
+
|
|
|
+func (m *LeaseInternalResponse) Reset() { *m = LeaseInternalResponse{} }
|
|
|
+func (m *LeaseInternalResponse) String() string { return proto.CompactTextString(m) }
|
|
|
+func (*LeaseInternalResponse) ProtoMessage() {}
|
|
|
+func (*LeaseInternalResponse) Descriptor() ([]byte, []int) { return fileDescriptorLease, []int{2} }
|
|
|
+
|
|
|
func init() {
|
|
|
proto.RegisterType((*Lease)(nil), "leasepb.Lease")
|
|
|
+ proto.RegisterType((*LeaseInternalRequest)(nil), "leasepb.LeaseInternalRequest")
|
|
|
+ proto.RegisterType((*LeaseInternalResponse)(nil), "leasepb.LeaseInternalResponse")
|
|
|
}
|
|
|
func (m *Lease) Marshal() (data []byte, err error) {
|
|
|
size := m.Size()
|
|
|
@@ -73,6 +97,62 @@ func (m *Lease) MarshalTo(data []byte) (int, error) {
|
|
|
return i, nil
|
|
|
}
|
|
|
|
|
|
+func (m *LeaseInternalRequest) Marshal() (data []byte, err error) {
|
|
|
+ size := m.Size()
|
|
|
+ data = make([]byte, size)
|
|
|
+ n, err := m.MarshalTo(data)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return data[:n], nil
|
|
|
+}
|
|
|
+
|
|
|
+func (m *LeaseInternalRequest) MarshalTo(data []byte) (int, error) {
|
|
|
+ var i int
|
|
|
+ _ = i
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.LeaseTimeToLiveRequest != nil {
|
|
|
+ data[i] = 0xa
|
|
|
+ i++
|
|
|
+ i = encodeVarintLease(data, i, uint64(m.LeaseTimeToLiveRequest.Size()))
|
|
|
+ n1, err := m.LeaseTimeToLiveRequest.MarshalTo(data[i:])
|
|
|
+ if err != nil {
|
|
|
+ return 0, err
|
|
|
+ }
|
|
|
+ i += n1
|
|
|
+ }
|
|
|
+ return i, nil
|
|
|
+}
|
|
|
+
|
|
|
+func (m *LeaseInternalResponse) Marshal() (data []byte, err error) {
|
|
|
+ size := m.Size()
|
|
|
+ data = make([]byte, size)
|
|
|
+ n, err := m.MarshalTo(data)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return data[:n], nil
|
|
|
+}
|
|
|
+
|
|
|
+func (m *LeaseInternalResponse) MarshalTo(data []byte) (int, error) {
|
|
|
+ var i int
|
|
|
+ _ = i
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.LeaseTimeToLiveResponse != nil {
|
|
|
+ data[i] = 0xa
|
|
|
+ i++
|
|
|
+ i = encodeVarintLease(data, i, uint64(m.LeaseTimeToLiveResponse.Size()))
|
|
|
+ n2, err := m.LeaseTimeToLiveResponse.MarshalTo(data[i:])
|
|
|
+ if err != nil {
|
|
|
+ return 0, err
|
|
|
+ }
|
|
|
+ i += n2
|
|
|
+ }
|
|
|
+ return i, nil
|
|
|
+}
|
|
|
+
|
|
|
func encodeFixed64Lease(data []byte, offset int, v uint64) int {
|
|
|
data[offset] = uint8(v)
|
|
|
data[offset+1] = uint8(v >> 8)
|
|
|
@@ -112,6 +192,26 @@ func (m *Lease) Size() (n int) {
|
|
|
return n
|
|
|
}
|
|
|
|
|
|
+func (m *LeaseInternalRequest) Size() (n int) {
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.LeaseTimeToLiveRequest != nil {
|
|
|
+ l = m.LeaseTimeToLiveRequest.Size()
|
|
|
+ n += 1 + l + sovLease(uint64(l))
|
|
|
+ }
|
|
|
+ return n
|
|
|
+}
|
|
|
+
|
|
|
+func (m *LeaseInternalResponse) Size() (n int) {
|
|
|
+ var l int
|
|
|
+ _ = l
|
|
|
+ if m.LeaseTimeToLiveResponse != nil {
|
|
|
+ l = m.LeaseTimeToLiveResponse.Size()
|
|
|
+ n += 1 + l + sovLease(uint64(l))
|
|
|
+ }
|
|
|
+ return n
|
|
|
+}
|
|
|
+
|
|
|
func sovLease(x uint64) (n int) {
|
|
|
for {
|
|
|
n++
|
|
|
@@ -213,6 +313,172 @@ func (m *Lease) Unmarshal(data []byte) error {
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
+func (m *LeaseInternalRequest) Unmarshal(data []byte) error {
|
|
|
+ l := len(data)
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
+ preIndex := iNdEx
|
|
|
+ var wire uint64
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowLease
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ wire |= (uint64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fieldNum := int32(wire >> 3)
|
|
|
+ wireType := int(wire & 0x7)
|
|
|
+ if wireType == 4 {
|
|
|
+ return fmt.Errorf("proto: LeaseInternalRequest: wiretype end group for non-group")
|
|
|
+ }
|
|
|
+ if fieldNum <= 0 {
|
|
|
+ return fmt.Errorf("proto: LeaseInternalRequest: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
+ }
|
|
|
+ switch fieldNum {
|
|
|
+ case 1:
|
|
|
+ if wireType != 2 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field LeaseTimeToLiveRequest", wireType)
|
|
|
+ }
|
|
|
+ var msglen int
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowLease
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ msglen |= (int(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if msglen < 0 {
|
|
|
+ return ErrInvalidLengthLease
|
|
|
+ }
|
|
|
+ postIndex := iNdEx + msglen
|
|
|
+ if postIndex > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ if m.LeaseTimeToLiveRequest == nil {
|
|
|
+ m.LeaseTimeToLiveRequest = &etcdserverpb.LeaseTimeToLiveRequest{}
|
|
|
+ }
|
|
|
+ if err := m.LeaseTimeToLiveRequest.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ iNdEx = postIndex
|
|
|
+ default:
|
|
|
+ iNdEx = preIndex
|
|
|
+ skippy, err := skipLease(data[iNdEx:])
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ if skippy < 0 {
|
|
|
+ return ErrInvalidLengthLease
|
|
|
+ }
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ iNdEx += skippy
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if iNdEx > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
+func (m *LeaseInternalResponse) Unmarshal(data []byte) error {
|
|
|
+ l := len(data)
|
|
|
+ iNdEx := 0
|
|
|
+ for iNdEx < l {
|
|
|
+ preIndex := iNdEx
|
|
|
+ var wire uint64
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowLease
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ wire |= (uint64(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fieldNum := int32(wire >> 3)
|
|
|
+ wireType := int(wire & 0x7)
|
|
|
+ if wireType == 4 {
|
|
|
+ return fmt.Errorf("proto: LeaseInternalResponse: wiretype end group for non-group")
|
|
|
+ }
|
|
|
+ if fieldNum <= 0 {
|
|
|
+ return fmt.Errorf("proto: LeaseInternalResponse: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
|
+ }
|
|
|
+ switch fieldNum {
|
|
|
+ case 1:
|
|
|
+ if wireType != 2 {
|
|
|
+ return fmt.Errorf("proto: wrong wireType = %d for field LeaseTimeToLiveResponse", wireType)
|
|
|
+ }
|
|
|
+ var msglen int
|
|
|
+ for shift := uint(0); ; shift += 7 {
|
|
|
+ if shift >= 64 {
|
|
|
+ return ErrIntOverflowLease
|
|
|
+ }
|
|
|
+ if iNdEx >= l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ b := data[iNdEx]
|
|
|
+ iNdEx++
|
|
|
+ msglen |= (int(b) & 0x7F) << shift
|
|
|
+ if b < 0x80 {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if msglen < 0 {
|
|
|
+ return ErrInvalidLengthLease
|
|
|
+ }
|
|
|
+ postIndex := iNdEx + msglen
|
|
|
+ if postIndex > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ if m.LeaseTimeToLiveResponse == nil {
|
|
|
+ m.LeaseTimeToLiveResponse = &etcdserverpb.LeaseTimeToLiveResponse{}
|
|
|
+ }
|
|
|
+ if err := m.LeaseTimeToLiveResponse.Unmarshal(data[iNdEx:postIndex]); err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ iNdEx = postIndex
|
|
|
+ default:
|
|
|
+ iNdEx = preIndex
|
|
|
+ skippy, err := skipLease(data[iNdEx:])
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ if skippy < 0 {
|
|
|
+ return ErrInvalidLengthLease
|
|
|
+ }
|
|
|
+ if (iNdEx + skippy) > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ iNdEx += skippy
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if iNdEx > l {
|
|
|
+ return io.ErrUnexpectedEOF
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|
|
|
func skipLease(data []byte) (n int, err error) {
|
|
|
l := len(data)
|
|
|
iNdEx := 0
|
|
|
@@ -319,13 +585,20 @@ var (
|
|
|
)
|
|
|
|
|
|
var fileDescriptorLease = []byte{
|
|
|
- // 126 bytes of a gzipped FileDescriptorProto
|
|
|
+ // 239 bytes of a gzipped FileDescriptorProto
|
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x49, 0x4d, 0x2c,
|
|
|
0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x07, 0x73, 0x0a, 0x92, 0xa4, 0x44, 0xd2,
|
|
|
- 0xf3, 0xd3, 0xf3, 0xc1, 0x62, 0xfa, 0x20, 0x16, 0x44, 0x5a, 0x49, 0x93, 0x8b, 0xd5, 0x07, 0xa4,
|
|
|
- 0x40, 0x88, 0x8f, 0x8b, 0xc9, 0xd3, 0x45, 0x82, 0x51, 0x81, 0x51, 0x83, 0x39, 0x88, 0x29, 0xd3,
|
|
|
- 0x45, 0x48, 0x80, 0x8b, 0x39, 0x24, 0xc4, 0x47, 0x82, 0x09, 0x2c, 0xc0, 0x5c, 0x12, 0xe2, 0xe3,
|
|
|
- 0x24, 0x71, 0xe2, 0xa1, 0x1c, 0xc3, 0x85, 0x87, 0x72, 0x0c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78,
|
|
|
- 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x8c, 0xc7, 0x72, 0x0c, 0x49, 0x6c, 0x60, 0xb3, 0x8c,
|
|
|
- 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0d, 0xa0, 0x42, 0x1a, 0x79, 0x00, 0x00, 0x00,
|
|
|
+ 0xf3, 0xd3, 0xf3, 0xc1, 0x62, 0xfa, 0x20, 0x16, 0x44, 0x5a, 0x4a, 0x2d, 0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