| Abhay Kumar | a2ae599 | 2025-11-10 14:02:24 +0000 | [diff] [blame^] | 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.ProtoPackageIsVersion3 // 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 | // 327 bytes of a gzipped FileDescriptorProto |
| 168 | 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0xc1, 0x6a, 0xfa, 0x40, |
| 169 | 0x10, 0xc6, 0xb3, 0x46, 0xa3, 0xff, 0x51, 0xfc, 0x87, 0x45, 0x68, 0x28, 0x34, 0xa4, 0x5e, 0x6a, |
| 170 | 0x29, 0x24, 0xa0, 0x87, 0xde, 0x4b, 0x73, 0xb2, 0x87, 0x12, 0x6c, 0x0f, 0xbd, 0x48, 0x8c, 0x83, |
| 171 | 0x84, 0xa8, 0x1b, 0x62, 0xba, 0x90, 0x37, 0xe9, 0xbd, 0xf7, 0x3e, 0x87, 0x47, 0x1f, 0xa1, 0xda, |
| 172 | 0x17, 0x29, 0x3b, 0x5b, 0xed, 0xa5, 0x97, 0xdd, 0x99, 0xef, 0xfb, 0xb1, 0xf3, 0x0d, 0x0b, 0xad, |
| 173 | 0x4c, 0xfa, 0x79, 0x21, 0x4a, 0xc1, 0xad, 0x95, 0x4c, 0x92, 0x7c, 0x76, 0xde, 0x5b, 0x88, 0x85, |
| 174 | 0x20, 0x29, 0x50, 0x95, 0x76, 0xfb, 0x1f, 0x0c, 0x5a, 0x63, 0xac, 0x9e, 0xe3, 0xe5, 0x2b, 0x72, |
| 175 | 0x1b, 0xcc, 0x0c, 0x2b, 0x87, 0x79, 0x6c, 0xd0, 0x89, 0x54, 0xc9, 0xaf, 0xe0, 0x7f, 0x52, 0x60, |
| 176 | 0x5c, 0xe2, 0xb4, 0x40, 0x99, 0x6e, 0x52, 0xb1, 0x76, 0x6a, 0x1e, 0x1b, 0x98, 0x51, 0x57, 0xcb, |
| 177 | 0xd1, 0x8f, 0xca, 0x2f, 0xa1, 0xb3, 0x12, 0xf3, 0x5f, 0xca, 0x24, 0xaa, 0xbd, 0x12, 0xf3, 0x13, |
| 178 | 0xe2, 0x40, 0x53, 0x62, 0x41, 0x6e, 0x9d, 0xdc, 0x63, 0xcb, 0x7b, 0xd0, 0x90, 0x2a, 0x80, 0xd3, |
| 179 | 0xa0, 0xc9, 0xba, 0x51, 0xea, 0x12, 0xe3, 0x0d, 0x3a, 0x16, 0xd1, 0xba, 0xe9, 0xbf, 0x33, 0x68, |
| 180 | 0x84, 0x12, 0xd7, 0x25, 0xbf, 0x81, 0x7a, 0x59, 0xe5, 0x48, 0x71, 0xbb, 0xc3, 0x33, 0x5f, 0xef, |
| 181 | 0xe9, 0x93, 0xa9, 0xcf, 0x49, 0x95, 0x63, 0x44, 0x10, 0xf7, 0xa0, 0x96, 0x49, 0xca, 0xde, 0x1e, |
| 182 | 0xda, 0x47, 0xf4, 0xb8, 0x78, 0x54, 0xcb, 0x24, 0xbf, 0x86, 0x66, 0x5e, 0xa0, 0x9c, 0x66, 0x92, |
| 183 | 0xc2, 0xff, 0x85, 0x59, 0x0a, 0x18, 0xcb, 0xbe, 0x07, 0xff, 0x4e, 0xef, 0xf3, 0x26, 0x98, 0x8f, |
| 184 | 0x4f, 0x13, 0xdb, 0xe0, 0x00, 0xd6, 0x7d, 0xf8, 0x10, 0x4e, 0x42, 0x9b, 0xdd, 0xdd, 0x6e, 0xf7, |
| 185 | 0xae, 0xb1, 0xdb, 0xbb, 0xc6, 0xf6, 0xe0, 0xb2, 0xdd, 0xc1, 0x65, 0x9f, 0x07, 0x97, 0xbd, 0x7d, |
| 186 | 0xb9, 0xc6, 0xcb, 0xc5, 0x42, 0xf8, 0x58, 0x26, 0x73, 0x3f, 0x15, 0x81, 0xba, 0x83, 0x38, 0x4f, |
| 187 | 0x03, 0x39, 0x0a, 0xf4, 0xac, 0x99, 0x45, 0xdf, 0x32, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x78, |
| 188 | 0x06, 0x46, 0xf5, 0xc0, 0x01, 0x00, 0x00, |
| 189 | } |
| 190 | |
| 191 | func (m *KeyValue) Marshal() (dAtA []byte, err error) { |
| 192 | size := m.Size() |
| 193 | dAtA = make([]byte, size) |
| 194 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 195 | if err != nil { |
| 196 | return nil, err |
| 197 | } |
| 198 | return dAtA[:n], nil |
| 199 | } |
| 200 | |
| 201 | func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { |
| 202 | size := m.Size() |
| 203 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 204 | } |
| 205 | |
| 206 | func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 207 | i := len(dAtA) |
| 208 | _ = i |
| 209 | var l int |
| 210 | _ = l |
| 211 | if m.XXX_unrecognized != nil { |
| 212 | i -= len(m.XXX_unrecognized) |
| 213 | copy(dAtA[i:], m.XXX_unrecognized) |
| 214 | } |
| 215 | if m.Lease != 0 { |
| 216 | i = encodeVarintKv(dAtA, i, uint64(m.Lease)) |
| 217 | i-- |
| 218 | dAtA[i] = 0x30 |
| 219 | } |
| 220 | if len(m.Value) > 0 { |
| 221 | i -= len(m.Value) |
| 222 | copy(dAtA[i:], m.Value) |
| 223 | i = encodeVarintKv(dAtA, i, uint64(len(m.Value))) |
| 224 | i-- |
| 225 | dAtA[i] = 0x2a |
| 226 | } |
| 227 | if m.Version != 0 { |
| 228 | i = encodeVarintKv(dAtA, i, uint64(m.Version)) |
| 229 | i-- |
| 230 | dAtA[i] = 0x20 |
| 231 | } |
| 232 | if m.ModRevision != 0 { |
| 233 | i = encodeVarintKv(dAtA, i, uint64(m.ModRevision)) |
| 234 | i-- |
| 235 | dAtA[i] = 0x18 |
| 236 | } |
| 237 | if m.CreateRevision != 0 { |
| 238 | i = encodeVarintKv(dAtA, i, uint64(m.CreateRevision)) |
| 239 | i-- |
| 240 | dAtA[i] = 0x10 |
| 241 | } |
| 242 | if len(m.Key) > 0 { |
| 243 | i -= len(m.Key) |
| 244 | copy(dAtA[i:], m.Key) |
| 245 | i = encodeVarintKv(dAtA, i, uint64(len(m.Key))) |
| 246 | i-- |
| 247 | dAtA[i] = 0xa |
| 248 | } |
| 249 | return len(dAtA) - i, nil |
| 250 | } |
| 251 | |
| 252 | func (m *Event) Marshal() (dAtA []byte, err error) { |
| 253 | size := m.Size() |
| 254 | dAtA = make([]byte, size) |
| 255 | n, err := m.MarshalToSizedBuffer(dAtA[:size]) |
| 256 | if err != nil { |
| 257 | return nil, err |
| 258 | } |
| 259 | return dAtA[:n], nil |
| 260 | } |
| 261 | |
| 262 | func (m *Event) MarshalTo(dAtA []byte) (int, error) { |
| 263 | size := m.Size() |
| 264 | return m.MarshalToSizedBuffer(dAtA[:size]) |
| 265 | } |
| 266 | |
| 267 | func (m *Event) MarshalToSizedBuffer(dAtA []byte) (int, error) { |
| 268 | i := len(dAtA) |
| 269 | _ = i |
| 270 | var l int |
| 271 | _ = l |
| 272 | if m.XXX_unrecognized != nil { |
| 273 | i -= len(m.XXX_unrecognized) |
| 274 | copy(dAtA[i:], m.XXX_unrecognized) |
| 275 | } |
| 276 | if m.PrevKv != nil { |
| 277 | { |
| 278 | size, err := m.PrevKv.MarshalToSizedBuffer(dAtA[:i]) |
| 279 | if err != nil { |
| 280 | return 0, err |
| 281 | } |
| 282 | i -= size |
| 283 | i = encodeVarintKv(dAtA, i, uint64(size)) |
| 284 | } |
| 285 | i-- |
| 286 | dAtA[i] = 0x1a |
| 287 | } |
| 288 | if m.Kv != nil { |
| 289 | { |
| 290 | size, err := m.Kv.MarshalToSizedBuffer(dAtA[:i]) |
| 291 | if err != nil { |
| 292 | return 0, err |
| 293 | } |
| 294 | i -= size |
| 295 | i = encodeVarintKv(dAtA, i, uint64(size)) |
| 296 | } |
| 297 | i-- |
| 298 | dAtA[i] = 0x12 |
| 299 | } |
| 300 | if m.Type != 0 { |
| 301 | i = encodeVarintKv(dAtA, i, uint64(m.Type)) |
| 302 | i-- |
| 303 | dAtA[i] = 0x8 |
| 304 | } |
| 305 | return len(dAtA) - i, nil |
| 306 | } |
| 307 | |
| 308 | func encodeVarintKv(dAtA []byte, offset int, v uint64) int { |
| 309 | offset -= sovKv(v) |
| 310 | base := offset |
| 311 | for v >= 1<<7 { |
| 312 | dAtA[offset] = uint8(v&0x7f | 0x80) |
| 313 | v >>= 7 |
| 314 | offset++ |
| 315 | } |
| 316 | dAtA[offset] = uint8(v) |
| 317 | return base |
| 318 | } |
| 319 | func (m *KeyValue) Size() (n int) { |
| 320 | if m == nil { |
| 321 | return 0 |
| 322 | } |
| 323 | var l int |
| 324 | _ = l |
| 325 | l = len(m.Key) |
| 326 | if l > 0 { |
| 327 | n += 1 + l + sovKv(uint64(l)) |
| 328 | } |
| 329 | if m.CreateRevision != 0 { |
| 330 | n += 1 + sovKv(uint64(m.CreateRevision)) |
| 331 | } |
| 332 | if m.ModRevision != 0 { |
| 333 | n += 1 + sovKv(uint64(m.ModRevision)) |
| 334 | } |
| 335 | if m.Version != 0 { |
| 336 | n += 1 + sovKv(uint64(m.Version)) |
| 337 | } |
| 338 | l = len(m.Value) |
| 339 | if l > 0 { |
| 340 | n += 1 + l + sovKv(uint64(l)) |
| 341 | } |
| 342 | if m.Lease != 0 { |
| 343 | n += 1 + sovKv(uint64(m.Lease)) |
| 344 | } |
| 345 | if m.XXX_unrecognized != nil { |
| 346 | n += len(m.XXX_unrecognized) |
| 347 | } |
| 348 | return n |
| 349 | } |
| 350 | |
| 351 | func (m *Event) Size() (n int) { |
| 352 | if m == nil { |
| 353 | return 0 |
| 354 | } |
| 355 | var l int |
| 356 | _ = l |
| 357 | if m.Type != 0 { |
| 358 | n += 1 + sovKv(uint64(m.Type)) |
| 359 | } |
| 360 | if m.Kv != nil { |
| 361 | l = m.Kv.Size() |
| 362 | n += 1 + l + sovKv(uint64(l)) |
| 363 | } |
| 364 | if m.PrevKv != nil { |
| 365 | l = m.PrevKv.Size() |
| 366 | n += 1 + l + sovKv(uint64(l)) |
| 367 | } |
| 368 | if m.XXX_unrecognized != nil { |
| 369 | n += len(m.XXX_unrecognized) |
| 370 | } |
| 371 | return n |
| 372 | } |
| 373 | |
| 374 | func sovKv(x uint64) (n int) { |
| 375 | return (math_bits.Len64(x|1) + 6) / 7 |
| 376 | } |
| 377 | func sozKv(x uint64) (n int) { |
| 378 | return sovKv(uint64((x << 1) ^ uint64((int64(x) >> 63)))) |
| 379 | } |
| 380 | func (m *KeyValue) Unmarshal(dAtA []byte) error { |
| 381 | l := len(dAtA) |
| 382 | iNdEx := 0 |
| 383 | for iNdEx < l { |
| 384 | preIndex := iNdEx |
| 385 | var wire uint64 |
| 386 | for shift := uint(0); ; shift += 7 { |
| 387 | if shift >= 64 { |
| 388 | return ErrIntOverflowKv |
| 389 | } |
| 390 | if iNdEx >= l { |
| 391 | return io.ErrUnexpectedEOF |
| 392 | } |
| 393 | b := dAtA[iNdEx] |
| 394 | iNdEx++ |
| 395 | wire |= uint64(b&0x7F) << shift |
| 396 | if b < 0x80 { |
| 397 | break |
| 398 | } |
| 399 | } |
| 400 | fieldNum := int32(wire >> 3) |
| 401 | wireType := int(wire & 0x7) |
| 402 | if wireType == 4 { |
| 403 | return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") |
| 404 | } |
| 405 | if fieldNum <= 0 { |
| 406 | return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) |
| 407 | } |
| 408 | switch fieldNum { |
| 409 | case 1: |
| 410 | if wireType != 2 { |
| 411 | return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) |
| 412 | } |
| 413 | var byteLen int |
| 414 | for shift := uint(0); ; shift += 7 { |
| 415 | if shift >= 64 { |
| 416 | return ErrIntOverflowKv |
| 417 | } |
| 418 | if iNdEx >= l { |
| 419 | return io.ErrUnexpectedEOF |
| 420 | } |
| 421 | b := dAtA[iNdEx] |
| 422 | iNdEx++ |
| 423 | byteLen |= int(b&0x7F) << shift |
| 424 | if b < 0x80 { |
| 425 | break |
| 426 | } |
| 427 | } |
| 428 | if byteLen < 0 { |
| 429 | return ErrInvalidLengthKv |
| 430 | } |
| 431 | postIndex := iNdEx + byteLen |
| 432 | if postIndex < 0 { |
| 433 | return ErrInvalidLengthKv |
| 434 | } |
| 435 | if postIndex > l { |
| 436 | return io.ErrUnexpectedEOF |
| 437 | } |
| 438 | m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) |
| 439 | if m.Key == nil { |
| 440 | m.Key = []byte{} |
| 441 | } |
| 442 | iNdEx = postIndex |
| 443 | case 2: |
| 444 | if wireType != 0 { |
| 445 | return fmt.Errorf("proto: wrong wireType = %d for field CreateRevision", wireType) |
| 446 | } |
| 447 | m.CreateRevision = 0 |
| 448 | for shift := uint(0); ; shift += 7 { |
| 449 | if shift >= 64 { |
| 450 | return ErrIntOverflowKv |
| 451 | } |
| 452 | if iNdEx >= l { |
| 453 | return io.ErrUnexpectedEOF |
| 454 | } |
| 455 | b := dAtA[iNdEx] |
| 456 | iNdEx++ |
| 457 | m.CreateRevision |= int64(b&0x7F) << shift |
| 458 | if b < 0x80 { |
| 459 | break |
| 460 | } |
| 461 | } |
| 462 | case 3: |
| 463 | if wireType != 0 { |
| 464 | return fmt.Errorf("proto: wrong wireType = %d for field ModRevision", wireType) |
| 465 | } |
| 466 | m.ModRevision = 0 |
| 467 | for shift := uint(0); ; shift += 7 { |
| 468 | if shift >= 64 { |
| 469 | return ErrIntOverflowKv |
| 470 | } |
| 471 | if iNdEx >= l { |
| 472 | return io.ErrUnexpectedEOF |
| 473 | } |
| 474 | b := dAtA[iNdEx] |
| 475 | iNdEx++ |
| 476 | m.ModRevision |= int64(b&0x7F) << shift |
| 477 | if b < 0x80 { |
| 478 | break |
| 479 | } |
| 480 | } |
| 481 | case 4: |
| 482 | if wireType != 0 { |
| 483 | return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) |
| 484 | } |
| 485 | m.Version = 0 |
| 486 | for shift := uint(0); ; shift += 7 { |
| 487 | if shift >= 64 { |
| 488 | return ErrIntOverflowKv |
| 489 | } |
| 490 | if iNdEx >= l { |
| 491 | return io.ErrUnexpectedEOF |
| 492 | } |
| 493 | b := dAtA[iNdEx] |
| 494 | iNdEx++ |
| 495 | m.Version |= int64(b&0x7F) << shift |
| 496 | if b < 0x80 { |
| 497 | break |
| 498 | } |
| 499 | } |
| 500 | case 5: |
| 501 | if wireType != 2 { |
| 502 | return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) |
| 503 | } |
| 504 | var byteLen int |
| 505 | for shift := uint(0); ; shift += 7 { |
| 506 | if shift >= 64 { |
| 507 | return ErrIntOverflowKv |
| 508 | } |
| 509 | if iNdEx >= l { |
| 510 | return io.ErrUnexpectedEOF |
| 511 | } |
| 512 | b := dAtA[iNdEx] |
| 513 | iNdEx++ |
| 514 | byteLen |= int(b&0x7F) << shift |
| 515 | if b < 0x80 { |
| 516 | break |
| 517 | } |
| 518 | } |
| 519 | if byteLen < 0 { |
| 520 | return ErrInvalidLengthKv |
| 521 | } |
| 522 | postIndex := iNdEx + byteLen |
| 523 | if postIndex < 0 { |
| 524 | return ErrInvalidLengthKv |
| 525 | } |
| 526 | if postIndex > l { |
| 527 | return io.ErrUnexpectedEOF |
| 528 | } |
| 529 | m.Value = append(m.Value[:0], dAtA[iNdEx:postIndex]...) |
| 530 | if m.Value == nil { |
| 531 | m.Value = []byte{} |
| 532 | } |
| 533 | iNdEx = postIndex |
| 534 | case 6: |
| 535 | if wireType != 0 { |
| 536 | return fmt.Errorf("proto: wrong wireType = %d for field Lease", wireType) |
| 537 | } |
| 538 | m.Lease = 0 |
| 539 | for shift := uint(0); ; shift += 7 { |
| 540 | if shift >= 64 { |
| 541 | return ErrIntOverflowKv |
| 542 | } |
| 543 | if iNdEx >= l { |
| 544 | return io.ErrUnexpectedEOF |
| 545 | } |
| 546 | b := dAtA[iNdEx] |
| 547 | iNdEx++ |
| 548 | m.Lease |= int64(b&0x7F) << shift |
| 549 | if b < 0x80 { |
| 550 | break |
| 551 | } |
| 552 | } |
| 553 | default: |
| 554 | iNdEx = preIndex |
| 555 | skippy, err := skipKv(dAtA[iNdEx:]) |
| 556 | if err != nil { |
| 557 | return err |
| 558 | } |
| 559 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 560 | return ErrInvalidLengthKv |
| 561 | } |
| 562 | if (iNdEx + skippy) > l { |
| 563 | return io.ErrUnexpectedEOF |
| 564 | } |
| 565 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 566 | iNdEx += skippy |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | if iNdEx > l { |
| 571 | return io.ErrUnexpectedEOF |
| 572 | } |
| 573 | return nil |
| 574 | } |
| 575 | func (m *Event) Unmarshal(dAtA []byte) error { |
| 576 | l := len(dAtA) |
| 577 | iNdEx := 0 |
| 578 | for iNdEx < l { |
| 579 | preIndex := iNdEx |
| 580 | var wire uint64 |
| 581 | for shift := uint(0); ; shift += 7 { |
| 582 | if shift >= 64 { |
| 583 | return ErrIntOverflowKv |
| 584 | } |
| 585 | if iNdEx >= l { |
| 586 | return io.ErrUnexpectedEOF |
| 587 | } |
| 588 | b := dAtA[iNdEx] |
| 589 | iNdEx++ |
| 590 | wire |= uint64(b&0x7F) << shift |
| 591 | if b < 0x80 { |
| 592 | break |
| 593 | } |
| 594 | } |
| 595 | fieldNum := int32(wire >> 3) |
| 596 | wireType := int(wire & 0x7) |
| 597 | if wireType == 4 { |
| 598 | return fmt.Errorf("proto: Event: wiretype end group for non-group") |
| 599 | } |
| 600 | if fieldNum <= 0 { |
| 601 | return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire) |
| 602 | } |
| 603 | switch fieldNum { |
| 604 | case 1: |
| 605 | if wireType != 0 { |
| 606 | return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) |
| 607 | } |
| 608 | m.Type = 0 |
| 609 | for shift := uint(0); ; shift += 7 { |
| 610 | if shift >= 64 { |
| 611 | return ErrIntOverflowKv |
| 612 | } |
| 613 | if iNdEx >= l { |
| 614 | return io.ErrUnexpectedEOF |
| 615 | } |
| 616 | b := dAtA[iNdEx] |
| 617 | iNdEx++ |
| 618 | m.Type |= Event_EventType(b&0x7F) << shift |
| 619 | if b < 0x80 { |
| 620 | break |
| 621 | } |
| 622 | } |
| 623 | case 2: |
| 624 | if wireType != 2 { |
| 625 | return fmt.Errorf("proto: wrong wireType = %d for field Kv", wireType) |
| 626 | } |
| 627 | var msglen int |
| 628 | for shift := uint(0); ; shift += 7 { |
| 629 | if shift >= 64 { |
| 630 | return ErrIntOverflowKv |
| 631 | } |
| 632 | if iNdEx >= l { |
| 633 | return io.ErrUnexpectedEOF |
| 634 | } |
| 635 | b := dAtA[iNdEx] |
| 636 | iNdEx++ |
| 637 | msglen |= int(b&0x7F) << shift |
| 638 | if b < 0x80 { |
| 639 | break |
| 640 | } |
| 641 | } |
| 642 | if msglen < 0 { |
| 643 | return ErrInvalidLengthKv |
| 644 | } |
| 645 | postIndex := iNdEx + msglen |
| 646 | if postIndex < 0 { |
| 647 | return ErrInvalidLengthKv |
| 648 | } |
| 649 | if postIndex > l { |
| 650 | return io.ErrUnexpectedEOF |
| 651 | } |
| 652 | if m.Kv == nil { |
| 653 | m.Kv = &KeyValue{} |
| 654 | } |
| 655 | if err := m.Kv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 656 | return err |
| 657 | } |
| 658 | iNdEx = postIndex |
| 659 | case 3: |
| 660 | if wireType != 2 { |
| 661 | return fmt.Errorf("proto: wrong wireType = %d for field PrevKv", wireType) |
| 662 | } |
| 663 | var msglen int |
| 664 | for shift := uint(0); ; shift += 7 { |
| 665 | if shift >= 64 { |
| 666 | return ErrIntOverflowKv |
| 667 | } |
| 668 | if iNdEx >= l { |
| 669 | return io.ErrUnexpectedEOF |
| 670 | } |
| 671 | b := dAtA[iNdEx] |
| 672 | iNdEx++ |
| 673 | msglen |= int(b&0x7F) << shift |
| 674 | if b < 0x80 { |
| 675 | break |
| 676 | } |
| 677 | } |
| 678 | if msglen < 0 { |
| 679 | return ErrInvalidLengthKv |
| 680 | } |
| 681 | postIndex := iNdEx + msglen |
| 682 | if postIndex < 0 { |
| 683 | return ErrInvalidLengthKv |
| 684 | } |
| 685 | if postIndex > l { |
| 686 | return io.ErrUnexpectedEOF |
| 687 | } |
| 688 | if m.PrevKv == nil { |
| 689 | m.PrevKv = &KeyValue{} |
| 690 | } |
| 691 | if err := m.PrevKv.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { |
| 692 | return err |
| 693 | } |
| 694 | iNdEx = postIndex |
| 695 | default: |
| 696 | iNdEx = preIndex |
| 697 | skippy, err := skipKv(dAtA[iNdEx:]) |
| 698 | if err != nil { |
| 699 | return err |
| 700 | } |
| 701 | if (skippy < 0) || (iNdEx+skippy) < 0 { |
| 702 | return ErrInvalidLengthKv |
| 703 | } |
| 704 | if (iNdEx + skippy) > l { |
| 705 | return io.ErrUnexpectedEOF |
| 706 | } |
| 707 | m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) |
| 708 | iNdEx += skippy |
| 709 | } |
| 710 | } |
| 711 | |
| 712 | if iNdEx > l { |
| 713 | return io.ErrUnexpectedEOF |
| 714 | } |
| 715 | return nil |
| 716 | } |
| 717 | func skipKv(dAtA []byte) (n int, err error) { |
| 718 | l := len(dAtA) |
| 719 | iNdEx := 0 |
| 720 | depth := 0 |
| 721 | for iNdEx < l { |
| 722 | var wire uint64 |
| 723 | for shift := uint(0); ; shift += 7 { |
| 724 | if shift >= 64 { |
| 725 | return 0, ErrIntOverflowKv |
| 726 | } |
| 727 | if iNdEx >= l { |
| 728 | return 0, io.ErrUnexpectedEOF |
| 729 | } |
| 730 | b := dAtA[iNdEx] |
| 731 | iNdEx++ |
| 732 | wire |= (uint64(b) & 0x7F) << shift |
| 733 | if b < 0x80 { |
| 734 | break |
| 735 | } |
| 736 | } |
| 737 | wireType := int(wire & 0x7) |
| 738 | switch wireType { |
| 739 | case 0: |
| 740 | for shift := uint(0); ; shift += 7 { |
| 741 | if shift >= 64 { |
| 742 | return 0, ErrIntOverflowKv |
| 743 | } |
| 744 | if iNdEx >= l { |
| 745 | return 0, io.ErrUnexpectedEOF |
| 746 | } |
| 747 | iNdEx++ |
| 748 | if dAtA[iNdEx-1] < 0x80 { |
| 749 | break |
| 750 | } |
| 751 | } |
| 752 | case 1: |
| 753 | iNdEx += 8 |
| 754 | case 2: |
| 755 | var length int |
| 756 | for shift := uint(0); ; shift += 7 { |
| 757 | if shift >= 64 { |
| 758 | return 0, ErrIntOverflowKv |
| 759 | } |
| 760 | if iNdEx >= l { |
| 761 | return 0, io.ErrUnexpectedEOF |
| 762 | } |
| 763 | b := dAtA[iNdEx] |
| 764 | iNdEx++ |
| 765 | length |= (int(b) & 0x7F) << shift |
| 766 | if b < 0x80 { |
| 767 | break |
| 768 | } |
| 769 | } |
| 770 | if length < 0 { |
| 771 | return 0, ErrInvalidLengthKv |
| 772 | } |
| 773 | iNdEx += length |
| 774 | case 3: |
| 775 | depth++ |
| 776 | case 4: |
| 777 | if depth == 0 { |
| 778 | return 0, ErrUnexpectedEndOfGroupKv |
| 779 | } |
| 780 | depth-- |
| 781 | case 5: |
| 782 | iNdEx += 4 |
| 783 | default: |
| 784 | return 0, fmt.Errorf("proto: illegal wireType %d", wireType) |
| 785 | } |
| 786 | if iNdEx < 0 { |
| 787 | return 0, ErrInvalidLengthKv |
| 788 | } |
| 789 | if depth == 0 { |
| 790 | return iNdEx, nil |
| 791 | } |
| 792 | } |
| 793 | return 0, io.ErrUnexpectedEOF |
| 794 | } |
| 795 | |
| 796 | var ( |
| 797 | ErrInvalidLengthKv = fmt.Errorf("proto: negative length found during unmarshaling") |
| 798 | ErrIntOverflowKv = fmt.Errorf("proto: integer overflow") |
| 799 | ErrUnexpectedEndOfGroupKv = fmt.Errorf("proto: unexpected end of group") |
| 800 | ) |