github.com/containerd/Containerd@v1.4.13/api/types/descriptor.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: github.com/containerd/containerd/api/types/descriptor.proto 3 4 package types 5 6 import ( 7 fmt "fmt" 8 proto "github.com/gogo/protobuf/proto" 9 github_com_gogo_protobuf_sortkeys "github.com/gogo/protobuf/sortkeys" 10 github_com_opencontainers_go_digest "github.com/opencontainers/go-digest" 11 io "io" 12 math "math" 13 math_bits "math/bits" 14 reflect "reflect" 15 strings "strings" 16 ) 17 18 // Reference imports to suppress errors if they are not otherwise used. 19 var _ = proto.Marshal 20 var _ = fmt.Errorf 21 var _ = math.Inf 22 23 // This is a compile-time assertion to ensure that this generated file 24 // is compatible with the proto package it is being compiled against. 25 // A compilation error at this line likely means your copy of the 26 // proto package needs to be updated. 27 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 28 29 // Descriptor describes a blob in a content store. 30 // 31 // This descriptor can be used to reference content from an 32 // oci descriptor found in a manifest. 33 // See https://godoc.org/github.com/opencontainers/image-spec/specs-go/v1#Descriptor 34 type Descriptor struct { 35 MediaType string `protobuf:"bytes,1,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` 36 Digest github_com_opencontainers_go_digest.Digest `protobuf:"bytes,2,opt,name=digest,proto3,customtype=github.com/opencontainers/go-digest.Digest" json:"digest"` 37 Size_ int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"` 38 Annotations map[string]string `protobuf:"bytes,5,rep,name=annotations,proto3" json:"annotations,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` 39 XXX_NoUnkeyedLiteral struct{} `json:"-"` 40 XXX_unrecognized []byte `json:"-"` 41 XXX_sizecache int32 `json:"-"` 42 } 43 44 func (m *Descriptor) Reset() { *m = Descriptor{} } 45 func (*Descriptor) ProtoMessage() {} 46 func (*Descriptor) Descriptor() ([]byte, []int) { 47 return fileDescriptor_37f958df3707db9e, []int{0} 48 } 49 func (m *Descriptor) XXX_Unmarshal(b []byte) error { 50 return m.Unmarshal(b) 51 } 52 func (m *Descriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 53 if deterministic { 54 return xxx_messageInfo_Descriptor.Marshal(b, m, deterministic) 55 } else { 56 b = b[:cap(b)] 57 n, err := m.MarshalToSizedBuffer(b) 58 if err != nil { 59 return nil, err 60 } 61 return b[:n], nil 62 } 63 } 64 func (m *Descriptor) XXX_Merge(src proto.Message) { 65 xxx_messageInfo_Descriptor.Merge(m, src) 66 } 67 func (m *Descriptor) XXX_Size() int { 68 return m.Size() 69 } 70 func (m *Descriptor) XXX_DiscardUnknown() { 71 xxx_messageInfo_Descriptor.DiscardUnknown(m) 72 } 73 74 var xxx_messageInfo_Descriptor proto.InternalMessageInfo 75 76 func init() { 77 proto.RegisterType((*Descriptor)(nil), "containerd.types.Descriptor") 78 proto.RegisterMapType((map[string]string)(nil), "containerd.types.Descriptor.AnnotationsEntry") 79 } 80 81 func init() { 82 proto.RegisterFile("github.com/containerd/containerd/api/types/descriptor.proto", fileDescriptor_37f958df3707db9e) 83 } 84 85 var fileDescriptor_37f958df3707db9e = []byte{ 86 // 311 bytes of a gzipped FileDescriptorProto 87 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4e, 0xcf, 0x2c, 0xc9, 88 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d, 89 0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xa7, 0xa4, 0x16, 90 0x27, 0x17, 0x65, 0x16, 0x94, 0xe4, 0x17, 0xe9, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 91 0x94, 0xe9, 0x81, 0x95, 0x48, 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1, 0x58, 0x31, 0x59, 0x30, 0x3a, 103 0x79, 0x9d, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0x43, 0xc3, 0x23, 0x39, 0xc6, 0x13, 0x8f, 104 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x31, 0xca, 0x80, 0xf8, 0xd8, 0xb1, 105 0x06, 0x93, 0x11, 0x0c, 0x49, 0x6c, 0xe0, 0x30, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x22, 106 0x8a, 0x20, 0x4a, 0xda, 0x01, 0x00, 0x00, 107 } 108 109 func (m *Descriptor) Marshal() (dAtA []byte, err error) { 110 size := m.Size() 111 dAtA = make([]byte, size) 112 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 113 if err != nil { 114 return nil, err 115 } 116 return dAtA[:n], nil 117 } 118 119 func (m *Descriptor) MarshalTo(dAtA []byte) (int, error) { 120 size := m.Size() 121 return m.MarshalToSizedBuffer(dAtA[:size]) 122 } 123 124 func (m *Descriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { 125 i := len(dAtA) 126 _ = i 127 var l int 128 _ = l 129 if m.XXX_unrecognized != nil { 130 i -= len(m.XXX_unrecognized) 131 copy(dAtA[i:], m.XXX_unrecognized) 132 } 133 if len(m.Annotations) > 0 { 134 for k := range m.Annotations { 135 v := m.Annotations[k] 136 baseI := i 137 i -= len(v) 138 copy(dAtA[i:], v) 139 i = encodeVarintDescriptor(dAtA, i, uint64(len(v))) 140 i-- 141 dAtA[i] = 0x12 142 i -= len(k) 143 copy(dAtA[i:], k) 144 i = encodeVarintDescriptor(dAtA, i, uint64(len(k))) 145 i-- 146 dAtA[i] = 0xa 147 i = encodeVarintDescriptor(dAtA, i, uint64(baseI-i)) 148 i-- 149 dAtA[i] = 0x2a 150 } 151 } 152 if m.Size_ != 0 { 153 i = encodeVarintDescriptor(dAtA, i, uint64(m.Size_)) 154 i-- 155 dAtA[i] = 0x18 156 } 157 if len(m.Digest) > 0 { 158 i -= len(m.Digest) 159 copy(dAtA[i:], m.Digest) 160 i = encodeVarintDescriptor(dAtA, i, uint64(len(m.Digest))) 161 i-- 162 dAtA[i] = 0x12 163 } 164 if len(m.MediaType) > 0 { 165 i -= len(m.MediaType) 166 copy(dAtA[i:], m.MediaType) 167 i = encodeVarintDescriptor(dAtA, i, uint64(len(m.MediaType))) 168 i-- 169 dAtA[i] = 0xa 170 } 171 return len(dAtA) - i, nil 172 } 173 174 func encodeVarintDescriptor(dAtA []byte, offset int, v uint64) int { 175 offset -= sovDescriptor(v) 176 base := offset 177 for v >= 1<<7 { 178 dAtA[offset] = uint8(v&0x7f | 0x80) 179 v >>= 7 180 offset++ 181 } 182 dAtA[offset] = uint8(v) 183 return base 184 } 185 func (m *Descriptor) Size() (n int) { 186 if m == nil { 187 return 0 188 } 189 var l int 190 _ = l 191 l = len(m.MediaType) 192 if l > 0 { 193 n += 1 + l + sovDescriptor(uint64(l)) 194 } 195 l = len(m.Digest) 196 if l > 0 { 197 n += 1 + l + sovDescriptor(uint64(l)) 198 } 199 if m.Size_ != 0 { 200 n += 1 + sovDescriptor(uint64(m.Size_)) 201 } 202 if len(m.Annotations) > 0 { 203 for k, v := range m.Annotations { 204 _ = k 205 _ = v 206 mapEntrySize := 1 + len(k) + sovDescriptor(uint64(len(k))) + 1 + len(v) + sovDescriptor(uint64(len(v))) 207 n += mapEntrySize + 1 + sovDescriptor(uint64(mapEntrySize)) 208 } 209 } 210 if m.XXX_unrecognized != nil { 211 n += len(m.XXX_unrecognized) 212 } 213 return n 214 } 215 216 func sovDescriptor(x uint64) (n int) { 217 return (math_bits.Len64(x|1) + 6) / 7 218 } 219 func sozDescriptor(x uint64) (n int) { 220 return sovDescriptor(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 221 } 222 func (this *Descriptor) String() string { 223 if this == nil { 224 return "nil" 225 } 226 keysForAnnotations := make([]string, 0, len(this.Annotations)) 227 for k, _ := range this.Annotations { 228 keysForAnnotations = append(keysForAnnotations, k) 229 } 230 github_com_gogo_protobuf_sortkeys.Strings(keysForAnnotations) 231 mapStringForAnnotations := "map[string]string{" 232 for _, k := range keysForAnnotations { 233 mapStringForAnnotations += fmt.Sprintf("%v: %v,", k, this.Annotations[k]) 234 } 235 mapStringForAnnotations += "}" 236 s := strings.Join([]string{`&Descriptor{`, 237 `MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`, 238 `Digest:` + fmt.Sprintf("%v", this.Digest) + `,`, 239 `Size_:` + fmt.Sprintf("%v", this.Size_) + `,`, 240 `Annotations:` + mapStringForAnnotations + `,`, 241 `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, 242 `}`, 243 }, "") 244 return s 245 } 246 func valueToStringDescriptor(v interface{}) string { 247 rv := reflect.ValueOf(v) 248 if rv.IsNil() { 249 return "nil" 250 } 251 pv := reflect.Indirect(rv).Interface() 252 return fmt.Sprintf("*%v", pv) 253 } 254 func (m *Descriptor) Unmarshal(dAtA []byte) error { 255 l := len(dAtA) 256 iNdEx := 0 257 for iNdEx < l { 258 preIndex := iNdEx 259 var wire uint64 260 for shift := uint(0); ; shift += 7 { 261 if shift >= 64 { 262 return ErrIntOverflowDescriptor 263 } 264 if iNdEx >= l { 265 return io.ErrUnexpectedEOF 266 } 267 b := dAtA[iNdEx] 268 iNdEx++ 269 wire |= uint64(b&0x7F) << shift 270 if b < 0x80 { 271 break 272 } 273 } 274 fieldNum := int32(wire >> 3) 275 wireType := int(wire & 0x7) 276 if wireType == 4 { 277 return fmt.Errorf("proto: Descriptor: wiretype end group for non-group") 278 } 279 if fieldNum <= 0 { 280 return fmt.Errorf("proto: Descriptor: illegal tag %d (wire type %d)", fieldNum, wire) 281 } 282 switch fieldNum { 283 case 1: 284 if wireType != 2 { 285 return fmt.Errorf("proto: wrong wireType = %d for field MediaType", wireType) 286 } 287 var stringLen uint64 288 for shift := uint(0); ; shift += 7 { 289 if shift >= 64 { 290 return ErrIntOverflowDescriptor 291 } 292 if iNdEx >= l { 293 return io.ErrUnexpectedEOF 294 } 295 b := dAtA[iNdEx] 296 iNdEx++ 297 stringLen |= uint64(b&0x7F) << shift 298 if b < 0x80 { 299 break 300 } 301 } 302 intStringLen := int(stringLen) 303 if intStringLen < 0 { 304 return ErrInvalidLengthDescriptor 305 } 306 postIndex := iNdEx + intStringLen 307 if postIndex < 0 { 308 return ErrInvalidLengthDescriptor 309 } 310 if postIndex > l { 311 return io.ErrUnexpectedEOF 312 } 313 m.MediaType = string(dAtA[iNdEx:postIndex]) 314 iNdEx = postIndex 315 case 2: 316 if wireType != 2 { 317 return fmt.Errorf("proto: wrong wireType = %d for field Digest", wireType) 318 } 319 var stringLen uint64 320 for shift := uint(0); ; shift += 7 { 321 if shift >= 64 { 322 return ErrIntOverflowDescriptor 323 } 324 if iNdEx >= l { 325 return io.ErrUnexpectedEOF 326 } 327 b := dAtA[iNdEx] 328 iNdEx++ 329 stringLen |= uint64(b&0x7F) << shift 330 if b < 0x80 { 331 break 332 } 333 } 334 intStringLen := int(stringLen) 335 if intStringLen < 0 { 336 return ErrInvalidLengthDescriptor 337 } 338 postIndex := iNdEx + intStringLen 339 if postIndex < 0 { 340 return ErrInvalidLengthDescriptor 341 } 342 if postIndex > l { 343 return io.ErrUnexpectedEOF 344 } 345 m.Digest = github_com_opencontainers_go_digest.Digest(dAtA[iNdEx:postIndex]) 346 iNdEx = postIndex 347 case 3: 348 if wireType != 0 { 349 return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) 350 } 351 m.Size_ = 0 352 for shift := uint(0); ; shift += 7 { 353 if shift >= 64 { 354 return ErrIntOverflowDescriptor 355 } 356 if iNdEx >= l { 357 return io.ErrUnexpectedEOF 358 } 359 b := dAtA[iNdEx] 360 iNdEx++ 361 m.Size_ |= int64(b&0x7F) << shift 362 if b < 0x80 { 363 break 364 } 365 } 366 case 5: 367 if wireType != 2 { 368 return fmt.Errorf("proto: wrong wireType = %d for field Annotations", wireType) 369 } 370 var msglen int 371 for shift := uint(0); ; shift += 7 { 372 if shift >= 64 { 373 return ErrIntOverflowDescriptor 374 } 375 if iNdEx >= l { 376 return io.ErrUnexpectedEOF 377 } 378 b := dAtA[iNdEx] 379 iNdEx++ 380 msglen |= int(b&0x7F) << shift 381 if b < 0x80 { 382 break 383 } 384 } 385 if msglen < 0 { 386 return ErrInvalidLengthDescriptor 387 } 388 postIndex := iNdEx + msglen 389 if postIndex < 0 { 390 return ErrInvalidLengthDescriptor 391 } 392 if postIndex > l { 393 return io.ErrUnexpectedEOF 394 } 395 if m.Annotations == nil { 396 m.Annotations = make(map[string]string) 397 } 398 var mapkey string 399 var mapvalue string 400 for iNdEx < postIndex { 401 entryPreIndex := iNdEx 402 var wire uint64 403 for shift := uint(0); ; shift += 7 { 404 if shift >= 64 { 405 return ErrIntOverflowDescriptor 406 } 407 if iNdEx >= l { 408 return io.ErrUnexpectedEOF 409 } 410 b := dAtA[iNdEx] 411 iNdEx++ 412 wire |= uint64(b&0x7F) << shift 413 if b < 0x80 { 414 break 415 } 416 } 417 fieldNum := int32(wire >> 3) 418 if fieldNum == 1 { 419 var stringLenmapkey uint64 420 for shift := uint(0); ; shift += 7 { 421 if shift >= 64 { 422 return ErrIntOverflowDescriptor 423 } 424 if iNdEx >= l { 425 return io.ErrUnexpectedEOF 426 } 427 b := dAtA[iNdEx] 428 iNdEx++ 429 stringLenmapkey |= uint64(b&0x7F) << shift 430 if b < 0x80 { 431 break 432 } 433 } 434 intStringLenmapkey := int(stringLenmapkey) 435 if intStringLenmapkey < 0 { 436 return ErrInvalidLengthDescriptor 437 } 438 postStringIndexmapkey := iNdEx + intStringLenmapkey 439 if postStringIndexmapkey < 0 { 440 return ErrInvalidLengthDescriptor 441 } 442 if postStringIndexmapkey > l { 443 return io.ErrUnexpectedEOF 444 } 445 mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) 446 iNdEx = postStringIndexmapkey 447 } else if fieldNum == 2 { 448 var stringLenmapvalue uint64 449 for shift := uint(0); ; shift += 7 { 450 if shift >= 64 { 451 return ErrIntOverflowDescriptor 452 } 453 if iNdEx >= l { 454 return io.ErrUnexpectedEOF 455 } 456 b := dAtA[iNdEx] 457 iNdEx++ 458 stringLenmapvalue |= uint64(b&0x7F) << shift 459 if b < 0x80 { 460 break 461 } 462 } 463 intStringLenmapvalue := int(stringLenmapvalue) 464 if intStringLenmapvalue < 0 { 465 return ErrInvalidLengthDescriptor 466 } 467 postStringIndexmapvalue := iNdEx + intStringLenmapvalue 468 if postStringIndexmapvalue < 0 { 469 return ErrInvalidLengthDescriptor 470 } 471 if postStringIndexmapvalue > l { 472 return io.ErrUnexpectedEOF 473 } 474 mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) 475 iNdEx = postStringIndexmapvalue 476 } else { 477 iNdEx = entryPreIndex 478 skippy, err := skipDescriptor(dAtA[iNdEx:]) 479 if err != nil { 480 return err 481 } 482 if (skippy < 0) || (iNdEx+skippy) < 0 { 483 return ErrInvalidLengthDescriptor 484 } 485 if (iNdEx + skippy) > postIndex { 486 return io.ErrUnexpectedEOF 487 } 488 iNdEx += skippy 489 } 490 } 491 m.Annotations[mapkey] = mapvalue 492 iNdEx = postIndex 493 default: 494 iNdEx = preIndex 495 skippy, err := skipDescriptor(dAtA[iNdEx:]) 496 if err != nil { 497 return err 498 } 499 if (skippy < 0) || (iNdEx+skippy) < 0 { 500 return ErrInvalidLengthDescriptor 501 } 502 if (iNdEx + skippy) > l { 503 return io.ErrUnexpectedEOF 504 } 505 m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) 506 iNdEx += skippy 507 } 508 } 509 510 if iNdEx > l { 511 return io.ErrUnexpectedEOF 512 } 513 return nil 514 } 515 func skipDescriptor(dAtA []byte) (n int, err error) { 516 l := len(dAtA) 517 iNdEx := 0 518 depth := 0 519 for iNdEx < l { 520 var wire uint64 521 for shift := uint(0); ; shift += 7 { 522 if shift >= 64 { 523 return 0, ErrIntOverflowDescriptor 524 } 525 if iNdEx >= l { 526 return 0, io.ErrUnexpectedEOF 527 } 528 b := dAtA[iNdEx] 529 iNdEx++ 530 wire |= (uint64(b) & 0x7F) << shift 531 if b < 0x80 { 532 break 533 } 534 } 535 wireType := int(wire & 0x7) 536 switch wireType { 537 case 0: 538 for shift := uint(0); ; shift += 7 { 539 if shift >= 64 { 540 return 0, ErrIntOverflowDescriptor 541 } 542 if iNdEx >= l { 543 return 0, io.ErrUnexpectedEOF 544 } 545 iNdEx++ 546 if dAtA[iNdEx-1] < 0x80 { 547 break 548 } 549 } 550 case 1: 551 iNdEx += 8 552 case 2: 553 var length int 554 for shift := uint(0); ; shift += 7 { 555 if shift >= 64 { 556 return 0, ErrIntOverflowDescriptor 557 } 558 if iNdEx >= l { 559 return 0, io.ErrUnexpectedEOF 560 } 561 b := dAtA[iNdEx] 562 iNdEx++ 563 length |= (int(b) & 0x7F) << shift 564 if b < 0x80 { 565 break 566 } 567 } 568 if length < 0 { 569 return 0, ErrInvalidLengthDescriptor 570 } 571 iNdEx += length 572 case 3: 573 depth++ 574 case 4: 575 if depth == 0 { 576 return 0, ErrUnexpectedEndOfGroupDescriptor 577 } 578 depth-- 579 case 5: 580 iNdEx += 4 581 default: 582 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 583 } 584 if iNdEx < 0 { 585 return 0, ErrInvalidLengthDescriptor 586 } 587 if depth == 0 { 588 return iNdEx, nil 589 } 590 } 591 return 0, io.ErrUnexpectedEOF 592 } 593 594 var ( 595 ErrInvalidLengthDescriptor = fmt.Errorf("proto: negative length found during unmarshaling") 596 ErrIntOverflowDescriptor = fmt.Errorf("proto: integer overflow") 597 ErrUnexpectedEndOfGroupDescriptor = fmt.Errorf("proto: unexpected end of group") 598 )