github.com/containerd/Containerd@v1.4.13/api/events/snapshot.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: github.com/containerd/containerd/api/events/snapshot.proto 3 4 package events 5 6 import ( 7 fmt "fmt" 8 proto "github.com/gogo/protobuf/proto" 9 io "io" 10 math "math" 11 math_bits "math/bits" 12 reflect "reflect" 13 strings "strings" 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package 26 27 type SnapshotPrepare struct { 28 Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 29 Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"` 30 XXX_NoUnkeyedLiteral struct{} `json:"-"` 31 XXX_unrecognized []byte `json:"-"` 32 XXX_sizecache int32 `json:"-"` 33 } 34 35 func (m *SnapshotPrepare) Reset() { *m = SnapshotPrepare{} } 36 func (*SnapshotPrepare) ProtoMessage() {} 37 func (*SnapshotPrepare) Descriptor() ([]byte, []int) { 38 return fileDescriptor_bd6c184d3d9aa5f2, []int{0} 39 } 40 func (m *SnapshotPrepare) XXX_Unmarshal(b []byte) error { 41 return m.Unmarshal(b) 42 } 43 func (m *SnapshotPrepare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 44 if deterministic { 45 return xxx_messageInfo_SnapshotPrepare.Marshal(b, m, deterministic) 46 } else { 47 b = b[:cap(b)] 48 n, err := m.MarshalToSizedBuffer(b) 49 if err != nil { 50 return nil, err 51 } 52 return b[:n], nil 53 } 54 } 55 func (m *SnapshotPrepare) XXX_Merge(src proto.Message) { 56 xxx_messageInfo_SnapshotPrepare.Merge(m, src) 57 } 58 func (m *SnapshotPrepare) XXX_Size() int { 59 return m.Size() 60 } 61 func (m *SnapshotPrepare) XXX_DiscardUnknown() { 62 xxx_messageInfo_SnapshotPrepare.DiscardUnknown(m) 63 } 64 65 var xxx_messageInfo_SnapshotPrepare proto.InternalMessageInfo 66 67 type SnapshotCommit struct { 68 Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 69 Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` 70 XXX_NoUnkeyedLiteral struct{} `json:"-"` 71 XXX_unrecognized []byte `json:"-"` 72 XXX_sizecache int32 `json:"-"` 73 } 74 75 func (m *SnapshotCommit) Reset() { *m = SnapshotCommit{} } 76 func (*SnapshotCommit) ProtoMessage() {} 77 func (*SnapshotCommit) Descriptor() ([]byte, []int) { 78 return fileDescriptor_bd6c184d3d9aa5f2, []int{1} 79 } 80 func (m *SnapshotCommit) XXX_Unmarshal(b []byte) error { 81 return m.Unmarshal(b) 82 } 83 func (m *SnapshotCommit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 84 if deterministic { 85 return xxx_messageInfo_SnapshotCommit.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 *SnapshotCommit) XXX_Merge(src proto.Message) { 96 xxx_messageInfo_SnapshotCommit.Merge(m, src) 97 } 98 func (m *SnapshotCommit) XXX_Size() int { 99 return m.Size() 100 } 101 func (m *SnapshotCommit) XXX_DiscardUnknown() { 102 xxx_messageInfo_SnapshotCommit.DiscardUnknown(m) 103 } 104 105 var xxx_messageInfo_SnapshotCommit proto.InternalMessageInfo 106 107 type SnapshotRemove struct { 108 Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 109 XXX_NoUnkeyedLiteral struct{} `json:"-"` 110 XXX_unrecognized []byte `json:"-"` 111 XXX_sizecache int32 `json:"-"` 112 } 113 114 func (m *SnapshotRemove) Reset() { *m = SnapshotRemove{} } 115 func (*SnapshotRemove) ProtoMessage() {} 116 func (*SnapshotRemove) Descriptor() ([]byte, []int) { 117 return fileDescriptor_bd6c184d3d9aa5f2, []int{2} 118 } 119 func (m *SnapshotRemove) XXX_Unmarshal(b []byte) error { 120 return m.Unmarshal(b) 121 } 122 func (m *SnapshotRemove) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 123 if deterministic { 124 return xxx_messageInfo_SnapshotRemove.Marshal(b, m, deterministic) 125 } else { 126 b = b[:cap(b)] 127 n, err := m.MarshalToSizedBuffer(b) 128 if err != nil { 129 return nil, err 130 } 131 return b[:n], nil 132 } 133 } 134 func (m *SnapshotRemove) XXX_Merge(src proto.Message) { 135 xxx_messageInfo_SnapshotRemove.Merge(m, src) 136 } 137 func (m *SnapshotRemove) XXX_Size() int { 138 return m.Size() 139 } 140 func (m *SnapshotRemove) XXX_DiscardUnknown() { 141 xxx_messageInfo_SnapshotRemove.DiscardUnknown(m) 142 } 143 144 var xxx_messageInfo_SnapshotRemove proto.InternalMessageInfo 145 146 func init() { 147 proto.RegisterType((*SnapshotPrepare)(nil), "containerd.events.SnapshotPrepare") 148 proto.RegisterType((*SnapshotCommit)(nil), "containerd.events.SnapshotCommit") 149 proto.RegisterType((*SnapshotRemove)(nil), "containerd.events.SnapshotRemove") 150 } 151 152 func init() { 153 proto.RegisterFile("github.com/containerd/containerd/api/events/snapshot.proto", fileDescriptor_bd6c184d3d9aa5f2) 154 } 155 156 var fileDescriptor_bd6c184d3d9aa5f2 = []byte{ 157 // 235 bytes of a gzipped FileDescriptorProto 158 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4a, 0xcf, 0x2c, 0xc9, 159 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d, 160 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0x17, 0xe7, 161 0x25, 0x16, 0x14, 0x67, 0xe4, 0x97, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x22, 0x54, 162 0xe9, 0x41, 0x54, 0x48, 0x39, 0x10, 0x34, 0x0e, 0xac, 0x35, 0xa9, 0x34, 0x4d, 0xbf, 0x20, 0xa7, 163 0x34, 0x3d, 0x33, 0x4f, 0x3f, 0x2d, 0x33, 0x35, 0x27, 0xa5, 0x20, 0xb1, 0x24, 0x03, 0x62, 0xa8, 164 0x92, 0x35, 0x17, 0x7f, 0x30, 0xd4, 0x9a, 0x80, 0xa2, 0xd4, 0x82, 0xc4, 0xa2, 0x54, 0x21, 0x01, 165 0x2e, 0xe6, 0xec, 0xd4, 0x4a, 0x09, 0x46, 0x05, 0x46, 0x0d, 0xce, 0x20, 0x10, 0x53, 0x48, 0x8c, 166 0x8b, 0x0d, 0x24, 0x93, 0x57, 0x22, 0xc1, 0x04, 0x16, 0x84, 0xf2, 0x94, 0xcc, 0xb8, 0xf8, 0x60, 167 0x9a, 0x9d, 0xf3, 0x73, 0x73, 0x33, 0x4b, 0xb0, 0xe8, 0x15, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 168 0x85, 0xea, 0x04, 0xb3, 0x95, 0x94, 0x10, 0xfa, 0x82, 0x52, 0x73, 0xf3, 0xcb, 0xb0, 0xd8, 0xe9, 169 0x14, 0x70, 0xe2, 0xa1, 0x1c, 0xc3, 0x8d, 0x87, 0x72, 0x0c, 0x0d, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 170 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x05, 0x5f, 0xe4, 0x18, 0xa3, 171 0x8c, 0x48, 0x08, 0x47, 0x6b, 0x08, 0x15, 0xc1, 0x90, 0xc4, 0x06, 0xf6, 0xb3, 0x31, 0x20, 0x00, 172 0x00, 0xff, 0xff, 0x69, 0x66, 0xa9, 0x2a, 0x86, 0x01, 0x00, 0x00, 173 } 174 175 // Field returns the value for the given fieldpath as a string, if defined. 176 // If the value is not defined, the second value will be false. 177 func (m *SnapshotPrepare) Field(fieldpath []string) (string, bool) { 178 if len(fieldpath) == 0 { 179 return "", false 180 } 181 182 switch fieldpath[0] { 183 case "key": 184 return string(m.Key), len(m.Key) > 0 185 case "parent": 186 return string(m.Parent), len(m.Parent) > 0 187 } 188 return "", false 189 } 190 191 // Field returns the value for the given fieldpath as a string, if defined. 192 // If the value is not defined, the second value will be false. 193 func (m *SnapshotCommit) Field(fieldpath []string) (string, bool) { 194 if len(fieldpath) == 0 { 195 return "", false 196 } 197 198 switch fieldpath[0] { 199 case "key": 200 return string(m.Key), len(m.Key) > 0 201 case "name": 202 return string(m.Name), len(m.Name) > 0 203 } 204 return "", false 205 } 206 207 // Field returns the value for the given fieldpath as a string, if defined. 208 // If the value is not defined, the second value will be false. 209 func (m *SnapshotRemove) Field(fieldpath []string) (string, bool) { 210 if len(fieldpath) == 0 { 211 return "", false 212 } 213 214 switch fieldpath[0] { 215 case "key": 216 return string(m.Key), len(m.Key) > 0 217 } 218 return "", false 219 } 220 func (m *SnapshotPrepare) Marshal() (dAtA []byte, err error) { 221 size := m.Size() 222 dAtA = make([]byte, size) 223 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 224 if err != nil { 225 return nil, err 226 } 227 return dAtA[:n], nil 228 } 229 230 func (m *SnapshotPrepare) MarshalTo(dAtA []byte) (int, error) { 231 size := m.Size() 232 return m.MarshalToSizedBuffer(dAtA[:size]) 233 } 234 235 func (m *SnapshotPrepare) MarshalToSizedBuffer(dAtA []byte) (int, error) { 236 i := len(dAtA) 237 _ = i 238 var l int 239 _ = l 240 if m.XXX_unrecognized != nil { 241 i -= len(m.XXX_unrecognized) 242 copy(dAtA[i:], m.XXX_unrecognized) 243 } 244 if len(m.Parent) > 0 { 245 i -= len(m.Parent) 246 copy(dAtA[i:], m.Parent) 247 i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Parent))) 248 i-- 249 dAtA[i] = 0x12 250 } 251 if len(m.Key) > 0 { 252 i -= len(m.Key) 253 copy(dAtA[i:], m.Key) 254 i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key))) 255 i-- 256 dAtA[i] = 0xa 257 } 258 return len(dAtA) - i, nil 259 } 260 261 func (m *SnapshotCommit) Marshal() (dAtA []byte, err error) { 262 size := m.Size() 263 dAtA = make([]byte, size) 264 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 265 if err != nil { 266 return nil, err 267 } 268 return dAtA[:n], nil 269 } 270 271 func (m *SnapshotCommit) MarshalTo(dAtA []byte) (int, error) { 272 size := m.Size() 273 return m.MarshalToSizedBuffer(dAtA[:size]) 274 } 275 276 func (m *SnapshotCommit) MarshalToSizedBuffer(dAtA []byte) (int, error) { 277 i := len(dAtA) 278 _ = i 279 var l int 280 _ = l 281 if m.XXX_unrecognized != nil { 282 i -= len(m.XXX_unrecognized) 283 copy(dAtA[i:], m.XXX_unrecognized) 284 } 285 if len(m.Name) > 0 { 286 i -= len(m.Name) 287 copy(dAtA[i:], m.Name) 288 i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Name))) 289 i-- 290 dAtA[i] = 0x12 291 } 292 if len(m.Key) > 0 { 293 i -= len(m.Key) 294 copy(dAtA[i:], m.Key) 295 i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key))) 296 i-- 297 dAtA[i] = 0xa 298 } 299 return len(dAtA) - i, nil 300 } 301 302 func (m *SnapshotRemove) Marshal() (dAtA []byte, err error) { 303 size := m.Size() 304 dAtA = make([]byte, size) 305 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 306 if err != nil { 307 return nil, err 308 } 309 return dAtA[:n], nil 310 } 311 312 func (m *SnapshotRemove) MarshalTo(dAtA []byte) (int, error) { 313 size := m.Size() 314 return m.MarshalToSizedBuffer(dAtA[:size]) 315 } 316 317 func (m *SnapshotRemove) MarshalToSizedBuffer(dAtA []byte) (int, error) { 318 i := len(dAtA) 319 _ = i 320 var l int 321 _ = l 322 if m.XXX_unrecognized != nil { 323 i -= len(m.XXX_unrecognized) 324 copy(dAtA[i:], m.XXX_unrecognized) 325 } 326 if len(m.Key) > 0 { 327 i -= len(m.Key) 328 copy(dAtA[i:], m.Key) 329 i = encodeVarintSnapshot(dAtA, i, uint64(len(m.Key))) 330 i-- 331 dAtA[i] = 0xa 332 } 333 return len(dAtA) - i, nil 334 } 335 336 func encodeVarintSnapshot(dAtA []byte, offset int, v uint64) int { 337 offset -= sovSnapshot(v) 338 base := offset 339 for v >= 1<<7 { 340 dAtA[offset] = uint8(v&0x7f | 0x80) 341 v >>= 7 342 offset++ 343 } 344 dAtA[offset] = uint8(v) 345 return base 346 } 347 func (m *SnapshotPrepare) Size() (n int) { 348 if m == nil { 349 return 0 350 } 351 var l int 352 _ = l 353 l = len(m.Key) 354 if l > 0 { 355 n += 1 + l + sovSnapshot(uint64(l)) 356 } 357 l = len(m.Parent) 358 if l > 0 { 359 n += 1 + l + sovSnapshot(uint64(l)) 360 } 361 if m.XXX_unrecognized != nil { 362 n += len(m.XXX_unrecognized) 363 } 364 return n 365 } 366 367 func (m *SnapshotCommit) Size() (n int) { 368 if m == nil { 369 return 0 370 } 371 var l int 372 _ = l 373 l = len(m.Key) 374 if l > 0 { 375 n += 1 + l + sovSnapshot(uint64(l)) 376 } 377 l = len(m.Name) 378 if l > 0 { 379 n += 1 + l + sovSnapshot(uint64(l)) 380 } 381 if m.XXX_unrecognized != nil { 382 n += len(m.XXX_unrecognized) 383 } 384 return n 385 } 386 387 func (m *SnapshotRemove) Size() (n int) { 388 if m == nil { 389 return 0 390 } 391 var l int 392 _ = l 393 l = len(m.Key) 394 if l > 0 { 395 n += 1 + l + sovSnapshot(uint64(l)) 396 } 397 if m.XXX_unrecognized != nil { 398 n += len(m.XXX_unrecognized) 399 } 400 return n 401 } 402 403 func sovSnapshot(x uint64) (n int) { 404 return (math_bits.Len64(x|1) + 6) / 7 405 } 406 func sozSnapshot(x uint64) (n int) { 407 return sovSnapshot(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 408 } 409 func (this *SnapshotPrepare) String() string { 410 if this == nil { 411 return "nil" 412 } 413 s := strings.Join([]string{`&SnapshotPrepare{`, 414 `Key:` + fmt.Sprintf("%v", this.Key) + `,`, 415 `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`, 416 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 417 `}`, 418 }, "") 419 return s 420 } 421 func (this *SnapshotCommit) String() string { 422 if this == nil { 423 return "nil" 424 } 425 s := strings.Join([]string{`&SnapshotCommit{`, 426 `Key:` + fmt.Sprintf("%v", this.Key) + `,`, 427 `Name:` + fmt.Sprintf("%v", this.Name) + `,`, 428 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 429 `}`, 430 }, "") 431 return s 432 } 433 func (this *SnapshotRemove) String() string { 434 if this == nil { 435 return "nil" 436 } 437 s := strings.Join([]string{`&SnapshotRemove{`, 438 `Key:` + fmt.Sprintf("%v", this.Key) + `,`, 439 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 440 `}`, 441 }, "") 442 return s 443 } 444 func valueToStringSnapshot(v interface{}) string { 445 rv := reflect.ValueOf(v) 446 if rv.IsNil() { 447 return "nil" 448 } 449 pv := reflect.Indirect(rv).Interface() 450 return fmt.Sprintf("*%v", pv) 451 } 452 func (m *SnapshotPrepare) Unmarshal(dAtA []byte) error { 453 l := len(dAtA) 454 iNdEx := 0 455 for iNdEx < l { 456 preIndex := iNdEx 457 var wire uint64 458 for shift := uint(0); ; shift += 7 { 459 if shift >= 64 { 460 return ErrIntOverflowSnapshot 461 } 462 if iNdEx >= l { 463 return io.ErrUnexpectedEOF 464 } 465 b := dAtA[iNdEx] 466 iNdEx++ 467 wire |= uint64(b&0x7F) << shift 468 if b < 0x80 { 469 break 470 } 471 } 472 fieldNum := int32(wire >> 3) 473 wireType := int(wire & 0x7) 474 if wireType == 4 { 475 return fmt.Errorf("proto: SnapshotPrepare: wiretype end group for non-group") 476 } 477 if fieldNum <= 0 { 478 return fmt.Errorf("proto: SnapshotPrepare: illegal tag %d (wire type %d)", fieldNum, wire) 479 } 480 switch fieldNum { 481 case 1: 482 if wireType != 2 { 483 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 484 } 485 var stringLen uint64 486 for shift := uint(0); ; shift += 7 { 487 if shift >= 64 { 488 return ErrIntOverflowSnapshot 489 } 490 if iNdEx >= l { 491 return io.ErrUnexpectedEOF 492 } 493 b := dAtA[iNdEx] 494 iNdEx++ 495 stringLen |= uint64(b&0x7F) << shift 496 if b < 0x80 { 497 break 498 } 499 } 500 intStringLen := int(stringLen) 501 if intStringLen < 0 { 502 return ErrInvalidLengthSnapshot 503 } 504 postIndex := iNdEx + intStringLen 505 if postIndex < 0 { 506 return ErrInvalidLengthSnapshot 507 } 508 if postIndex > l { 509 return io.ErrUnexpectedEOF 510 } 511 m.Key = string(dAtA[iNdEx:postIndex]) 512 iNdEx = postIndex 513 case 2: 514 if wireType != 2 { 515 return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) 516 } 517 var stringLen uint64 518 for shift := uint(0); ; shift += 7 { 519 if shift >= 64 { 520 return ErrIntOverflowSnapshot 521 } 522 if iNdEx >= l { 523 return io.ErrUnexpectedEOF 524 } 525 b := dAtA[iNdEx] 526 iNdEx++ 527 stringLen |= uint64(b&0x7F) << shift 528 if b < 0x80 { 529 break 530 } 531 } 532 intStringLen := int(stringLen) 533 if intStringLen < 0 { 534 return ErrInvalidLengthSnapshot 535 } 536 postIndex := iNdEx + intStringLen 537 if postIndex < 0 { 538 return ErrInvalidLengthSnapshot 539 } 540 if postIndex > l { 541 return io.ErrUnexpectedEOF 542 } 543 m.Parent = string(dAtA[iNdEx:postIndex]) 544 iNdEx = postIndex 545 default: 546 iNdEx = preIndex 547 skippy, err := skipSnapshot(dAtA[iNdEx:]) 548 if err != nil { 549 return err 550 } 551 if (skippy < 0) || (iNdEx+skippy) < 0 { 552 return ErrInvalidLengthSnapshot 553 } 554 if (iNdEx + skippy) > l { 555 return io.ErrUnexpectedEOF 556 } 557 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 558 iNdEx += skippy 559 } 560 } 561 562 if iNdEx > l { 563 return io.ErrUnexpectedEOF 564 } 565 return nil 566 } 567 func (m *SnapshotCommit) Unmarshal(dAtA []byte) error { 568 l := len(dAtA) 569 iNdEx := 0 570 for iNdEx < l { 571 preIndex := iNdEx 572 var wire uint64 573 for shift := uint(0); ; shift += 7 { 574 if shift >= 64 { 575 return ErrIntOverflowSnapshot 576 } 577 if iNdEx >= l { 578 return io.ErrUnexpectedEOF 579 } 580 b := dAtA[iNdEx] 581 iNdEx++ 582 wire |= uint64(b&0x7F) << shift 583 if b < 0x80 { 584 break 585 } 586 } 587 fieldNum := int32(wire >> 3) 588 wireType := int(wire & 0x7) 589 if wireType == 4 { 590 return fmt.Errorf("proto: SnapshotCommit: wiretype end group for non-group") 591 } 592 if fieldNum <= 0 { 593 return fmt.Errorf("proto: SnapshotCommit: illegal tag %d (wire type %d)", fieldNum, wire) 594 } 595 switch fieldNum { 596 case 1: 597 if wireType != 2 { 598 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 599 } 600 var stringLen uint64 601 for shift := uint(0); ; shift += 7 { 602 if shift >= 64 { 603 return ErrIntOverflowSnapshot 604 } 605 if iNdEx >= l { 606 return io.ErrUnexpectedEOF 607 } 608 b := dAtA[iNdEx] 609 iNdEx++ 610 stringLen |= uint64(b&0x7F) << shift 611 if b < 0x80 { 612 break 613 } 614 } 615 intStringLen := int(stringLen) 616 if intStringLen < 0 { 617 return ErrInvalidLengthSnapshot 618 } 619 postIndex := iNdEx + intStringLen 620 if postIndex < 0 { 621 return ErrInvalidLengthSnapshot 622 } 623 if postIndex > l { 624 return io.ErrUnexpectedEOF 625 } 626 m.Key = string(dAtA[iNdEx:postIndex]) 627 iNdEx = postIndex 628 case 2: 629 if wireType != 2 { 630 return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) 631 } 632 var stringLen uint64 633 for shift := uint(0); ; shift += 7 { 634 if shift >= 64 { 635 return ErrIntOverflowSnapshot 636 } 637 if iNdEx >= l { 638 return io.ErrUnexpectedEOF 639 } 640 b := dAtA[iNdEx] 641 iNdEx++ 642 stringLen |= uint64(b&0x7F) << shift 643 if b < 0x80 { 644 break 645 } 646 } 647 intStringLen := int(stringLen) 648 if intStringLen < 0 { 649 return ErrInvalidLengthSnapshot 650 } 651 postIndex := iNdEx + intStringLen 652 if postIndex < 0 { 653 return ErrInvalidLengthSnapshot 654 } 655 if postIndex > l { 656 return io.ErrUnexpectedEOF 657 } 658 m.Name = string(dAtA[iNdEx:postIndex]) 659 iNdEx = postIndex 660 default: 661 iNdEx = preIndex 662 skippy, err := skipSnapshot(dAtA[iNdEx:]) 663 if err != nil { 664 return err 665 } 666 if (skippy < 0) || (iNdEx+skippy) < 0 { 667 return ErrInvalidLengthSnapshot 668 } 669 if (iNdEx + skippy) > l { 670 return io.ErrUnexpectedEOF 671 } 672 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 673 iNdEx += skippy 674 } 675 } 676 677 if iNdEx > l { 678 return io.ErrUnexpectedEOF 679 } 680 return nil 681 } 682 func (m *SnapshotRemove) Unmarshal(dAtA []byte) error { 683 l := len(dAtA) 684 iNdEx := 0 685 for iNdEx < l { 686 preIndex := iNdEx 687 var wire uint64 688 for shift := uint(0); ; shift += 7 { 689 if shift >= 64 { 690 return ErrIntOverflowSnapshot 691 } 692 if iNdEx >= l { 693 return io.ErrUnexpectedEOF 694 } 695 b := dAtA[iNdEx] 696 iNdEx++ 697 wire |= uint64(b&0x7F) << shift 698 if b < 0x80 { 699 break 700 } 701 } 702 fieldNum := int32(wire >> 3) 703 wireType := int(wire & 0x7) 704 if wireType == 4 { 705 return fmt.Errorf("proto: SnapshotRemove: wiretype end group for non-group") 706 } 707 if fieldNum <= 0 { 708 return fmt.Errorf("proto: SnapshotRemove: illegal tag %d (wire type %d)", fieldNum, wire) 709 } 710 switch fieldNum { 711 case 1: 712 if wireType != 2 { 713 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 714 } 715 var stringLen uint64 716 for shift := uint(0); ; shift += 7 { 717 if shift >= 64 { 718 return ErrIntOverflowSnapshot 719 } 720 if iNdEx >= l { 721 return io.ErrUnexpectedEOF 722 } 723 b := dAtA[iNdEx] 724 iNdEx++ 725 stringLen |= uint64(b&0x7F) << shift 726 if b < 0x80 { 727 break 728 } 729 } 730 intStringLen := int(stringLen) 731 if intStringLen < 0 { 732 return ErrInvalidLengthSnapshot 733 } 734 postIndex := iNdEx + intStringLen 735 if postIndex < 0 { 736 return ErrInvalidLengthSnapshot 737 } 738 if postIndex > l { 739 return io.ErrUnexpectedEOF 740 } 741 m.Key = string(dAtA[iNdEx:postIndex]) 742 iNdEx = postIndex 743 default: 744 iNdEx = preIndex 745 skippy, err := skipSnapshot(dAtA[iNdEx:]) 746 if err != nil { 747 return err 748 } 749 if (skippy < 0) || (iNdEx+skippy) < 0 { 750 return ErrInvalidLengthSnapshot 751 } 752 if (iNdEx + skippy) > l { 753 return io.ErrUnexpectedEOF 754 } 755 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 756 iNdEx += skippy 757 } 758 } 759 760 if iNdEx > l { 761 return io.ErrUnexpectedEOF 762 } 763 return nil 764 } 765 func skipSnapshot(dAtA []byte) (n int, err error) { 766 l := len(dAtA) 767 iNdEx := 0 768 depth := 0 769 for iNdEx < l { 770 var wire uint64 771 for shift := uint(0); ; shift += 7 { 772 if shift >= 64 { 773 return 0, ErrIntOverflowSnapshot 774 } 775 if iNdEx >= l { 776 return 0, io.ErrUnexpectedEOF 777 } 778 b := dAtA[iNdEx] 779 iNdEx++ 780 wire |= (uint64(b) & 0x7F) << shift 781 if b < 0x80 { 782 break 783 } 784 } 785 wireType := int(wire & 0x7) 786 switch wireType { 787 case 0: 788 for shift := uint(0); ; shift += 7 { 789 if shift >= 64 { 790 return 0, ErrIntOverflowSnapshot 791 } 792 if iNdEx >= l { 793 return 0, io.ErrUnexpectedEOF 794 } 795 iNdEx++ 796 if dAtA[iNdEx-1] < 0x80 { 797 break 798 } 799 } 800 case 1: 801 iNdEx += 8 802 case 2: 803 var length int 804 for shift := uint(0); ; shift += 7 { 805 if shift >= 64 { 806 return 0, ErrIntOverflowSnapshot 807 } 808 if iNdEx >= l { 809 return 0, io.ErrUnexpectedEOF 810 } 811 b := dAtA[iNdEx] 812 iNdEx++ 813 length |= (int(b) & 0x7F) << shift 814 if b < 0x80 { 815 break 816 } 817 } 818 if length < 0 { 819 return 0, ErrInvalidLengthSnapshot 820 } 821 iNdEx += length 822 case 3: 823 depth++ 824 case 4: 825 if depth == 0 { 826 return 0, ErrUnexpectedEndOfGroupSnapshot 827 } 828 depth-- 829 case 5: 830 iNdEx += 4 831 default: 832 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 833 } 834 if iNdEx < 0 { 835 return 0, ErrInvalidLengthSnapshot 836 } 837 if depth == 0 { 838 return iNdEx, nil 839 } 840 } 841 return 0, io.ErrUnexpectedEOF 842 } 843 844 var ( 845 ErrInvalidLengthSnapshot = fmt.Errorf("proto: negative length found during unmarshaling") 846 ErrIntOverflowSnapshot = fmt.Errorf("proto: integer overflow") 847 ErrUnexpectedEndOfGroupSnapshot = fmt.Errorf("proto: unexpected end of group") 848 )