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