go.etcd.io/etcd@v3.3.27+incompatible/mvcc/mvccpb/kv.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: kv.proto
     3  
     4  package mvccpb
     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  )
    15  
    16  // Reference imports to suppress errors if they are not otherwise used.
    17  var _ = proto.Marshal
    18  var _ = fmt.Errorf
    19  var _ = math.Inf
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the proto package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // proto package needs to be updated.
    25  const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
    26  
    27  type Event_EventType int32
    28  
    29  const (
    30  	PUT    Event_EventType = 0
    31  	DELETE Event_EventType = 1
    32  )
    33  
    34  var Event_EventType_name = map[int32]string{
    35  	0: "PUT",
    36  	1: "DELETE",
    37  }
    38  
    39  var Event_EventType_value = map[string]int32{
    40  	"PUT":    0,
    41  	"DELETE": 1,
    42  }
    43  
    44  func (x Event_EventType) String() string {
    45  	return proto.EnumName(Event_EventType_name, int32(x))
    46  }
    47  
    48  func (Event_EventType) EnumDescriptor() ([]byte, []int) {
    49  	return fileDescriptor_2216fe83c9c12408, []int{1, 0}
    50  }
    51  
    52  type KeyValue struct {
    53  	// key is the key in bytes. An empty key is not allowed.
    54  	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
    55  	// create_revision is the revision of last creation on this key.
    56  	CreateRevision int64 `protobuf:"varint,2,opt,name=create_revision,json=createRevision,proto3" json:"create_revision,omitempty"`
    57  	// mod_revision is the revision of last modification on this key.
    58  	ModRevision int64 `protobuf:"varint,3,opt,name=mod_revision,json=modRevision,proto3" json:"mod_revision,omitempty"`
    59  	// version is the version of the key. A deletion resets
    60  	// the version to zero and any modification of the key
    61  	// increases its version.
    62  	Version int64 `protobuf:"varint,4,opt,name=version,proto3" json:"version,omitempty"`
    63  	// value is the value held by the key, in bytes.
    64  	Value []byte `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
    65  	// lease is the ID of the lease that attached to key.
    66  	// When the attached lease expires, the key will be deleted.
    67  	// If lease is 0, then no lease is attached to the key.
    68  	Lease                int64    `protobuf:"varint,6,opt,name=lease,proto3" json:"lease,omitempty"`
    69  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    70  	XXX_unrecognized     []byte   `json:"-"`
    71  	XXX_sizecache        int32    `json:"-"`
    72  }
    73  
    74  func (m *KeyValue) Reset()         { *m = KeyValue{} }
    75  func (m *KeyValue) String() string { return proto.CompactTextString(m) }
    76  func (*KeyValue) ProtoMessage()    {}
    77  func (*KeyValue) Descriptor() ([]byte, []int) {
    78  	return fileDescriptor_2216fe83c9c12408, []int{0}
    79  }
    80  func (m *KeyValue) XXX_Unmarshal(b []byte) error {
    81  	return m.Unmarshal(b)
    82  }
    83  func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    84  	if deterministic {
    85  		return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic)
    86  	} else {
    87  		b = b[:cap(b)]
    88  		n, err := m.MarshalToSizedBuffer(b)
    89  		if err != nil {
    90  			return nil, err
    91  		}
    92  		return b[:n], nil
    93  	}
    94  }
    95  func (m *KeyValue) XXX_Merge(src proto.Message) {
    96  	xxx_messageInfo_KeyValue.Merge(m, src)
    97  }
    98  func (m *KeyValue) XXX_Size() int {
    99  	return m.Size()
   100  }
   101  func (m *KeyValue) XXX_DiscardUnknown() {
   102  	xxx_messageInfo_KeyValue.DiscardUnknown(m)
   103  }
   104  
   105  var xxx_messageInfo_KeyValue proto.InternalMessageInfo
   106  
   107  type Event struct {
   108  	// type is the kind of event. If type is a PUT, it indicates
   109  	// new data has been stored to the key. If type is a DELETE,
   110  	// it indicates the key was deleted.
   111  	Type Event_EventType `protobuf:"varint,1,opt,name=type,proto3,enum=mvccpb.Event_EventType" json:"type,omitempty"`
   112  	// kv holds the KeyValue for the event.
   113  	// A PUT event contains current kv pair.
   114  	// A PUT event with kv.Version=1 indicates the creation of a key.
   115  	// A DELETE/EXPIRE event contains the deleted key with
   116  	// its modification revision set to the revision of deletion.
   117  	Kv *KeyValue `protobuf:"bytes,2,opt,name=kv,proto3" json:"kv,omitempty"`
   118  	// prev_kv holds the key-value pair before the event happens.
   119  	PrevKv               *KeyValue `protobuf:"bytes,3,opt,name=prev_kv,json=prevKv,proto3" json:"prev_kv,omitempty"`
   120  	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
   121  	XXX_unrecognized     []byte    `json:"-"`
   122  	XXX_sizecache        int32     `json:"-"`
   123  }
   124  
   125  func (m *Event) Reset()         { *m = Event{} }
   126  func (m *Event) String() string { return proto.CompactTextString(m) }
   127  func (*Event) ProtoMessage()    {}
   128  func (*Event) Descriptor() ([]byte, []int) {
   129  	return fileDescriptor_2216fe83c9c12408, []int{1}
   130  }
   131  func (m *Event) XXX_Unmarshal(b []byte) error {
   132  	return m.Unmarshal(b)
   133  }
   134  func (m *Event) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
   135  	if deterministic {
   136  		return xxx_messageInfo_Event.Marshal(b, m, deterministic)
   137  	} else {
   138  		b = b[:cap(b)]
   139  		n, err := m.MarshalToSizedBuffer(b)
   140  		if err != nil {
   141  			return nil, err
   142  		}
   143  		return b[:n], nil
   144  	}
   145  }
   146  func (m *Event) XXX_Merge(src proto.Message) {
   147  	xxx_messageInfo_Event.Merge(m, src)
   148  }
   149  func (m *Event) XXX_Size() int {
   150  	return m.Size()
   151  }
   152  func (m *Event) XXX_DiscardUnknown() {
   153  	xxx_messageInfo_Event.DiscardUnknown(m)
   154  }
   155  
   156  var xxx_messageInfo_Event proto.InternalMessageInfo
   157  
   158  func init() {
   159  	proto.RegisterEnum("mvccpb.Event_EventType", Event_EventType_name, Event_EventType_value)
   160  	proto.RegisterType((*KeyValue)(nil), "mvccpb.KeyValue")
   161  	proto.RegisterType((*Event)(nil), "mvccpb.Event")
   162  }
   163  
   164  func init() { proto.RegisterFile("kv.proto", fileDescriptor_2216fe83c9c12408) }
   165  
   166  var fileDescriptor_2216fe83c9c12408 = []byte{
   167  	// 303 bytes of a gzipped FileDescriptorProto
   168  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x41, 0x4e, 0xc2, 0x40,
   169  	0x14, 0x86, 0x3b, 0x14, 0x0a, 0x3e, 0x08, 0x36, 0x13, 0x12, 0x27, 0x2e, 0x26, 0x95, 0x8d, 0x18,
   170  	0x13, 0x4c, 0xf0, 0x06, 0xc6, 0xae, 0x70, 0x61, 0x1a, 0x74, 0x4b, 0x4a, 0x79, 0x21, 0xa4, 0x94,
   171  	0x69, 0x4a, 0x9d, 0xa4, 0x37, 0x71, 0xef, 0xde, 0x73, 0xb0, 0xe4, 0x08, 0x52, 0x2f, 0x62, 0xfa,
   172  	0xc6, 0xe2, 0xc6, 0xcd, 0xe4, 0xfd, 0xff, 0xff, 0x65, 0xe6, 0x7f, 0x03, 0x9d, 0x58, 0x8f, 0xd3,
   173  	0x4c, 0xe5, 0x8a, 0x3b, 0x89, 0x8e, 0xa2, 0x74, 0x71, 0x39, 0x58, 0xa9, 0x95, 0x22, 0xeb, 0xae,
   174  	0x9a, 0x4c, 0x3a, 0xfc, 0x64, 0xd0, 0x99, 0x62, 0xf1, 0x1a, 0x6e, 0xde, 0x90, 0xbb, 0x60, 0xc7,
   175  	0x58, 0x08, 0xe6, 0xb1, 0x51, 0x2f, 0xa8, 0x46, 0x7e, 0x0d, 0xe7, 0x51, 0x86, 0x61, 0x8e, 0xf3,
   176  	0x0c, 0xf5, 0x7a, 0xb7, 0x56, 0x5b, 0xd1, 0xf0, 0xd8, 0xc8, 0x0e, 0xfa, 0xc6, 0x0e, 0x7e, 0x5d,
   177  	0x7e, 0x05, 0xbd, 0x44, 0x2d, 0xff, 0x28, 0x9b, 0xa8, 0x6e, 0xa2, 0x96, 0x27, 0x44, 0x40, 0x5b,
   178  	0x63, 0x46, 0x69, 0x93, 0xd2, 0x5a, 0xf2, 0x01, 0xb4, 0x74, 0x55, 0x40, 0xb4, 0xe8, 0x65, 0x23,
   179  	0x2a, 0x77, 0x83, 0xe1, 0x0e, 0x85, 0x43, 0xb4, 0x11, 0xc3, 0x0f, 0x06, 0x2d, 0x5f, 0xe3, 0x36,
   180  	0xe7, 0xb7, 0xd0, 0xcc, 0x8b, 0x14, 0xa9, 0x6e, 0x7f, 0x72, 0x31, 0x36, 0x7b, 0x8e, 0x29, 0x34,
   181  	0xe7, 0xac, 0x48, 0x31, 0x20, 0x88, 0x7b, 0xd0, 0x88, 0x35, 0x75, 0xef, 0x4e, 0xdc, 0x1a, 0xad,
   182  	0x17, 0x0f, 0x1a, 0xb1, 0xe6, 0x37, 0xd0, 0x4e, 0x33, 0xd4, 0xf3, 0x58, 0x53, 0xf9, 0xff, 0x30,
   183  	0xa7, 0x02, 0xa6, 0x7a, 0xe8, 0xc1, 0xd9, 0xe9, 0x7e, 0xde, 0x06, 0xfb, 0xf9, 0x65, 0xe6, 0x5a,
   184  	0x1c, 0xc0, 0x79, 0xf4, 0x9f, 0xfc, 0x99, 0xef, 0xb2, 0x07, 0xb1, 0x3f, 0x4a, 0xeb, 0x70, 0x94,
   185  	0xd6, 0xbe, 0x94, 0xec, 0x50, 0x4a, 0xf6, 0x55, 0x4a, 0xf6, 0xfe, 0x2d, 0xad, 0x85, 0x43, 0xff,
   186  	0x7e, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0xb5, 0x45, 0x92, 0x5d, 0xa1, 0x01, 0x00, 0x00,
   187  }
   188  
   189  func (m *KeyValue) Marshal() (dAtA []byte, err error) {
   190  	size := m.Size()
   191  	dAtA = make([]byte, size)
   192  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   193  	if err != nil {
   194  		return nil, err
   195  	}
   196  	return dAtA[:n], nil
   197  }
   198  
   199  func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) {
   200  	size := m.Size()
   201  	return m.MarshalToSizedBuffer(dAtA[:size])
   202  }
   203  
   204  func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   205  	i := len(dAtA)
   206  	_ = i
   207  	var l int
   208  	_ = l
   209  	if m.XXX_unrecognized != nil {
   210  		i -= len(m.XXX_unrecognized)
   211  		copy(dAtA[i:], m.XXX_unrecognized)
   212  	}
   213  	if m.Lease != 0 {
   214  		i = encodeVarintKv(dAtA, i, uint64(m.Lease))
   215  		i--
   216  		dAtA[i] = 0x30
   217  	}
   218  	if len(m.Value) > 0 {
   219  		i -= len(m.Value)
   220  		copy(dAtA[i:], m.Value)
   221  		i = encodeVarintKv(dAtA, i, uint64(len(m.Value)))
   222  		i--
   223  		dAtA[i] = 0x2a
   224  	}
   225  	if m.Version != 0 {
   226  		i = encodeVarintKv(dAtA, i, uint64(m.Version))
   227  		i--
   228  		dAtA[i] = 0x20
   229  	}
   230  	if m.ModRevision != 0 {
   231  		i = encodeVarintKv(dAtA, i, uint64(m.ModRevision))
   232  		i--
   233  		dAtA[i] = 0x18
   234  	}
   235  	if m.CreateRevision != 0 {
   236  		i = encodeVarintKv(dAtA, i, uint64(m.CreateRevision))
   237  		i--
   238  		dAtA[i] = 0x10
   239  	}
   240  	if len(m.Key) > 0 {
   241  		i -= len(m.Key)
   242  		copy(dAtA[i:], m.Key)
   243  		i = encodeVarintKv(dAtA, i, uint64(len(m.Key)))
   244  		i--
   245  		dAtA[i] = 0xa
   246  	}
   247  	return len(dAtA) - i, nil
   248  }
   249  
   250  func (m *Event) Marshal() (dAtA []byte, err error) {
   251  	size := m.Size()
   252  	dAtA = make([]byte, size)
   253  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   254  	if err != nil {
   255  		return nil, err
   256  	}
   257  	return dAtA[:n], nil
   258  }
   259  
   260  func (m *Event) MarshalTo(dAtA []byte) (int, error) {
   261  	size := m.Size()
   262  	return m.MarshalToSizedBuffer(dAtA[:size])
   263  }
   264  
   265  func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   266  	i := len(dAtA)
   267  	_ = i
   268  	var l int
   269  	_ = l
   270  	if m.XXX_unrecognized != nil {
   271  		i -= len(m.XXX_unrecognized)
   272  		copy(dAtA[i:], m.XXX_unrecognized)
   273  	}
   274  	if m.PrevKv != nil {
   275  		{
   276  			size, err := m.PrevKv.MarshalToSizedBuffer(dAtA[:i])
   277  			if err != nil {
   278  				return 0, err
   279  			}
   280  			i -= size
   281  			i = encodeVarintKv(dAtA, i, uint64(size))
   282  		}
   283  		i--
   284  		dAtA[i] = 0x1a
   285  	}
   286  	if m.Kv != nil {
   287  		{
   288  			size, err := m.Kv.MarshalToSizedBuffer(dAtA[:i])
   289  			if err != nil {
   290  				return 0, err
   291  			}
   292  			i -= size
   293  			i = encodeVarintKv(dAtA, i, uint64(size))
   294  		}
   295  		i--
   296  		dAtA[i] = 0x12
   297  	}
   298  	if m.Type != 0 {
   299  		i = encodeVarintKv(dAtA, i, uint64(m.Type))
   300  		i--
   301  		dAtA[i] = 0x8
   302  	}
   303  	return len(dAtA) - i, nil
   304  }
   305  
   306  func encodeVarintKv(dAtA []byte, offset int, v uint64) int {
   307  	offset -= sovKv(v)
   308  	base := offset
   309  	for v >= 1<<7 {
   310  		dAtA[offset] = uint8(v&0x7f | 0x80)
   311  		v >>= 7
   312  		offset++
   313  	}
   314  	dAtA[offset] = uint8(v)
   315  	return base
   316  }
   317  func (m *KeyValue) Size() (n int) {
   318  	if m == nil {
   319  		return 0
   320  	}
   321  	var l int
   322  	_ = l
   323  	l = len(m.Key)
   324  	if l > 0 {
   325  		n += 1 + l + sovKv(uint64(l))
   326  	}
   327  	if m.CreateRevision != 0 {
   328  		n += 1 + sovKv(uint64(m.CreateRevision))
   329  	}
   330  	if m.ModRevision != 0 {
   331  		n += 1 + sovKv(uint64(m.ModRevision))
   332  	}
   333  	if m.Version != 0 {
   334  		n += 1 + sovKv(uint64(m.Version))
   335  	}
   336  	l = len(m.Value)
   337  	if l > 0 {
   338  		n += 1 + l + sovKv(uint64(l))
   339  	}
   340  	if m.Lease != 0 {
   341  		n += 1 + sovKv(uint64(m.Lease))
   342  	}
   343  	if m.XXX_unrecognized != nil {
   344  		n += len(m.XXX_unrecognized)
   345  	}
   346  	return n
   347  }
   348  
   349  func (m *Event) Size() (n int) {
   350  	if m == nil {
   351  		return 0
   352  	}
   353  	var l int
   354  	_ = l
   355  	if m.Type != 0 {
   356  		n += 1 + sovKv(uint64(m.Type))
   357  	}
   358  	if m.Kv != nil {
   359  		l = m.Kv.Size()
   360  		n += 1 + l + sovKv(uint64(l))
   361  	}
   362  	if m.PrevKv != nil {
   363  		l = m.PrevKv.Size()
   364  		n += 1 + l + sovKv(uint64(l))
   365  	}
   366  	if m.XXX_unrecognized != nil {
   367  		n += len(m.XXX_unrecognized)
   368  	}
   369  	return n
   370  }
   371  
   372  func sovKv(x uint64) (n int) {
   373  	return (math_bits.Len64(x|1) + 6) / 7
   374  }
   375  func sozKv(x uint64) (n int) {
   376  	return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   377  }
   378  func (m *KeyValue) Unmarshal(dAtA []byte) error {
   379  	l := len(dAtA)
   380  	iNdEx := 0
   381  	for iNdEx < l {
   382  		preIndex := iNdEx
   383  		var wire uint64
   384  		for shift := uint(0); ; shift += 7 {
   385  			if shift >= 64 {
   386  				return ErrIntOverflowKv
   387  			}
   388  			if iNdEx >= l {
   389  				return io.ErrUnexpectedEOF
   390  			}
   391  			b := dAtA[iNdEx]
   392  			iNdEx++
   393  			wire |= uint64(b&0x7F) << shift
   394  			if b < 0x80 {
   395  				break
   396  			}
   397  		}
   398  		fieldNum := int32(wire >> 3)
   399  		wireType := int(wire & 0x7)
   400  		if wireType == 4 {
   401  			return fmt.Errorf("proto: KeyValue: wiretype end group for non-group")
   402  		}
   403  		if fieldNum <= 0 {
   404  			return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire)
   405  		}
   406  		switch fieldNum {
   407  		case 1:
   408  			if wireType != 2 {
   409  				return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
   410  			}
   411  			var byteLen int
   412  			for shift := uint(0); ; shift += 7 {
   413  				if shift >= 64 {
   414  					return ErrIntOverflowKv
   415  				}
   416  				if iNdEx >= l {
   417  					return io.ErrUnexpectedEOF
   418  				}
   419  				b := dAtA[iNdEx]
   420  				iNdEx++
   421  				byteLen |= int(b&0x7F) << shift
   422  				if b < 0x80 {
   423  					break
   424  				}
   425  			}
   426  			if byteLen < 0 {
   427  				return ErrInvalidLengthKv
   428  			}
   429  			postIndex := iNdEx + byteLen
   430  			if postIndex < 0 {
   431  				return ErrInvalidLengthKv
   432  			}
   433  			if postIndex > l {
   434  				return io.ErrUnexpectedEOF
   435  			}
   436  			m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...)
   437  			if m.Key == nil {
   438  				m.Key = []byte{}
   439  			}
   440  			iNdEx = postIndex
   441  		case 2:
   442  			if wireType != 0 {
   443  				return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType)
   444  			}
   445  			m.CreateRevision = 0
   446  			for shift := uint(0); ; shift += 7 {
   447  				if shift >= 64 {
   448  					return ErrIntOverflowKv
   449  				}
   450  				if iNdEx >= l {
   451  					return io.ErrUnexpectedEOF
   452  				}
   453  				b := dAtA[iNdEx]
   454  				iNdEx++
   455  				m.CreateRevision |= int64(b&0x7F) << shift
   456  				if b < 0x80 {
   457  					break
   458  				}
   459  			}
   460  		case 3:
   461  			if wireType != 0 {
   462  				return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType)
   463  			}
   464  			m.ModRevision = 0
   465  			for shift := uint(0); ; shift += 7 {
   466  				if shift >= 64 {
   467  					return ErrIntOverflowKv
   468  				}
   469  				if iNdEx >= l {
   470  					return io.ErrUnexpectedEOF
   471  				}
   472  				b := dAtA[iNdEx]
   473  				iNdEx++
   474  				m.ModRevision |= int64(b&0x7F) << shift
   475  				if b < 0x80 {
   476  					break
   477  				}
   478  			}
   479  		case 4:
   480  			if wireType != 0 {
   481  				return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType)
   482  			}
   483  			m.Version = 0
   484  			for shift := uint(0); ; shift += 7 {
   485  				if shift >= 64 {
   486  					return ErrIntOverflowKv
   487  				}
   488  				if iNdEx >= l {
   489  					return io.ErrUnexpectedEOF
   490  				}
   491  				b := dAtA[iNdEx]
   492  				iNdEx++
   493  				m.Version |= int64(b&0x7F) << shift
   494  				if b < 0x80 {
   495  					break
   496  				}
   497  			}
   498  		case 5:
   499  			if wireType != 2 {
   500  				return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
   501  			}
   502  			var byteLen int
   503  			for shift := uint(0); ; shift += 7 {
   504  				if shift >= 64 {
   505  					return ErrIntOverflowKv
   506  				}
   507  				if iNdEx >= l {
   508  					return io.ErrUnexpectedEOF
   509  				}
   510  				b := dAtA[iNdEx]
   511  				iNdEx++
   512  				byteLen |= int(b&0x7F) << shift
   513  				if b < 0x80 {
   514  					break
   515  				}
   516  			}
   517  			if byteLen < 0 {
   518  				return ErrInvalidLengthKv
   519  			}
   520  			postIndex := iNdEx + byteLen
   521  			if postIndex < 0 {
   522  				return ErrInvalidLengthKv
   523  			}
   524  			if postIndex > l {
   525  				return io.ErrUnexpectedEOF
   526  			}
   527  			m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...)
   528  			if m.Value == nil {
   529  				m.Value = []byte{}
   530  			}
   531  			iNdEx = postIndex
   532  		case 6:
   533  			if wireType != 0 {
   534  				return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType)
   535  			}
   536  			m.Lease = 0
   537  			for shift := uint(0); ; shift += 7 {
   538  				if shift >= 64 {
   539  					return ErrIntOverflowKv
   540  				}
   541  				if iNdEx >= l {
   542  					return io.ErrUnexpectedEOF
   543  				}
   544  				b := dAtA[iNdEx]
   545  				iNdEx++
   546  				m.Lease |= int64(b&0x7F) << shift
   547  				if b < 0x80 {
   548  					break
   549  				}
   550  			}
   551  		default:
   552  			iNdEx = preIndex
   553  			skippy, err := skipKv(dAtA[iNdEx:])
   554  			if err != nil {
   555  				return err
   556  			}
   557  			if skippy < 0 {
   558  				return ErrInvalidLengthKv
   559  			}
   560  			if (iNdEx + skippy) < 0 {
   561  				return ErrInvalidLengthKv
   562  			}
   563  			if (iNdEx + skippy) > l {
   564  				return io.ErrUnexpectedEOF
   565  			}
   566  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   567  			iNdEx += skippy
   568  		}
   569  	}
   570  
   571  	if iNdEx > l {
   572  		return io.ErrUnexpectedEOF
   573  	}
   574  	return nil
   575  }
   576  func (m *Event) Unmarshal(dAtA []byte) error {
   577  	l := len(dAtA)
   578  	iNdEx := 0
   579  	for iNdEx < l {
   580  		preIndex := iNdEx
   581  		var wire uint64
   582  		for shift := uint(0); ; shift += 7 {
   583  			if shift >= 64 {
   584  				return ErrIntOverflowKv
   585  			}
   586  			if iNdEx >= l {
   587  				return io.ErrUnexpectedEOF
   588  			}
   589  			b := dAtA[iNdEx]
   590  			iNdEx++
   591  			wire |= uint64(b&0x7F) << shift
   592  			if b < 0x80 {
   593  				break
   594  			}
   595  		}
   596  		fieldNum := int32(wire >> 3)
   597  		wireType := int(wire & 0x7)
   598  		if wireType == 4 {
   599  			return fmt.Errorf("proto: Event: wiretype end group for non-group")
   600  		}
   601  		if fieldNum <= 0 {
   602  			return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire)
   603  		}
   604  		switch fieldNum {
   605  		case 1:
   606  			if wireType != 0 {
   607  				return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
   608  			}
   609  			m.Type = 0
   610  			for shift := uint(0); ; shift += 7 {
   611  				if shift >= 64 {
   612  					return ErrIntOverflowKv
   613  				}
   614  				if iNdEx >= l {
   615  					return io.ErrUnexpectedEOF
   616  				}
   617  				b := dAtA[iNdEx]
   618  				iNdEx++
   619  				m.Type |= Event_EventType(b&0x7F) << shift
   620  				if b < 0x80 {
   621  					break
   622  				}
   623  			}
   624  		case 2:
   625  			if wireType != 2 {
   626  				return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType)
   627  			}
   628  			var msglen int
   629  			for shift := uint(0); ; shift += 7 {
   630  				if shift >= 64 {
   631  					return ErrIntOverflowKv
   632  				}
   633  				if iNdEx >= l {
   634  					return io.ErrUnexpectedEOF
   635  				}
   636  				b := dAtA[iNdEx]
   637  				iNdEx++
   638  				msglen |= int(b&0x7F) << shift
   639  				if b < 0x80 {
   640  					break
   641  				}
   642  			}
   643  			if msglen < 0 {
   644  				return ErrInvalidLengthKv
   645  			}
   646  			postIndex := iNdEx + msglen
   647  			if postIndex < 0 {
   648  				return ErrInvalidLengthKv
   649  			}
   650  			if postIndex > l {
   651  				return io.ErrUnexpectedEOF
   652  			}
   653  			if m.Kv == nil {
   654  				m.Kv = &KeyValue{}
   655  			}
   656  			if err := m.Kv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   657  				return err
   658  			}
   659  			iNdEx = postIndex
   660  		case 3:
   661  			if wireType != 2 {
   662  				return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType)
   663  			}
   664  			var msglen int
   665  			for shift := uint(0); ; shift += 7 {
   666  				if shift >= 64 {
   667  					return ErrIntOverflowKv
   668  				}
   669  				if iNdEx >= l {
   670  					return io.ErrUnexpectedEOF
   671  				}
   672  				b := dAtA[iNdEx]
   673  				iNdEx++
   674  				msglen |= int(b&0x7F) << shift
   675  				if b < 0x80 {
   676  					break
   677  				}
   678  			}
   679  			if msglen < 0 {
   680  				return ErrInvalidLengthKv
   681  			}
   682  			postIndex := iNdEx + msglen
   683  			if postIndex < 0 {
   684  				return ErrInvalidLengthKv
   685  			}
   686  			if postIndex > l {
   687  				return io.ErrUnexpectedEOF
   688  			}
   689  			if m.PrevKv == nil {
   690  				m.PrevKv = &KeyValue{}
   691  			}
   692  			if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   693  				return err
   694  			}
   695  			iNdEx = postIndex
   696  		default:
   697  			iNdEx = preIndex
   698  			skippy, err := skipKv(dAtA[iNdEx:])
   699  			if err != nil {
   700  				return err
   701  			}
   702  			if skippy < 0 {
   703  				return ErrInvalidLengthKv
   704  			}
   705  			if (iNdEx + skippy) < 0 {
   706  				return ErrInvalidLengthKv
   707  			}
   708  			if (iNdEx + skippy) > l {
   709  				return io.ErrUnexpectedEOF
   710  			}
   711  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   712  			iNdEx += skippy
   713  		}
   714  	}
   715  
   716  	if iNdEx > l {
   717  		return io.ErrUnexpectedEOF
   718  	}
   719  	return nil
   720  }
   721  func skipKv(dAtA []byte) (n int, err error) {
   722  	l := len(dAtA)
   723  	iNdEx := 0
   724  	for iNdEx < l {
   725  		var wire uint64
   726  		for shift := uint(0); ; shift += 7 {
   727  			if shift >= 64 {
   728  				return 0, ErrIntOverflowKv
   729  			}
   730  			if iNdEx >= l {
   731  				return 0, io.ErrUnexpectedEOF
   732  			}
   733  			b := dAtA[iNdEx]
   734  			iNdEx++
   735  			wire |= (uint64(b) & 0x7F) << shift
   736  			if b < 0x80 {
   737  				break
   738  			}
   739  		}
   740  		wireType := int(wire & 0x7)
   741  		switch wireType {
   742  		case 0:
   743  			for shift := uint(0); ; shift += 7 {
   744  				if shift >= 64 {
   745  					return 0, ErrIntOverflowKv
   746  				}
   747  				if iNdEx >= l {
   748  					return 0, io.ErrUnexpectedEOF
   749  				}
   750  				iNdEx++
   751  				if dAtA[iNdEx-1] < 0x80 {
   752  					break
   753  				}
   754  			}
   755  			return iNdEx, nil
   756  		case 1:
   757  			iNdEx += 8
   758  			return iNdEx, nil
   759  		case 2:
   760  			var length int
   761  			for shift := uint(0); ; shift += 7 {
   762  				if shift >= 64 {
   763  					return 0, ErrIntOverflowKv
   764  				}
   765  				if iNdEx >= l {
   766  					return 0, io.ErrUnexpectedEOF
   767  				}
   768  				b := dAtA[iNdEx]
   769  				iNdEx++
   770  				length |= (int(b) & 0x7F) << shift
   771  				if b < 0x80 {
   772  					break
   773  				}
   774  			}
   775  			if length < 0 {
   776  				return 0, ErrInvalidLengthKv
   777  			}
   778  			iNdEx += length
   779  			if iNdEx < 0 {
   780  				return 0, ErrInvalidLengthKv
   781  			}
   782  			return iNdEx, nil
   783  		case 3:
   784  			for {
   785  				var innerWire uint64
   786  				var start int = iNdEx
   787  				for shift := uint(0); ; shift += 7 {
   788  					if shift >= 64 {
   789  						return 0, ErrIntOverflowKv
   790  					}
   791  					if iNdEx >= l {
   792  						return 0, io.ErrUnexpectedEOF
   793  					}
   794  					b := dAtA[iNdEx]
   795  					iNdEx++
   796  					innerWire |= (uint64(b) & 0x7F) << shift
   797  					if b < 0x80 {
   798  						break
   799  					}
   800  				}
   801  				innerWireType := int(innerWire & 0x7)
   802  				if innerWireType == 4 {
   803  					break
   804  				}
   805  				next, err := skipKv(dAtA[start:])
   806  				if err != nil {
   807  					return 0, err
   808  				}
   809  				iNdEx = start + next
   810  				if iNdEx < 0 {
   811  					return 0, ErrInvalidLengthKv
   812  				}
   813  			}
   814  			return iNdEx, nil
   815  		case 4:
   816  			return iNdEx, nil
   817  		case 5:
   818  			iNdEx += 4
   819  			return iNdEx, nil
   820  		default:
   821  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   822  		}
   823  	}
   824  	panic("unreachable")
   825  }
   826  
   827  var (
   828  	ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling")
   829  	ErrIntOverflowKv   = fmt.Errorf("proto: integer overflow")
   830  )