github.com/containerd/Containerd@v1.4.13/api/types/platform.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: github.com/containerd/containerd/api/types/platform.proto
     3  
     4  package types
     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  // Platform follows the structure of the OCI platform specification, from
    28  // descriptors.
    29  type Platform struct {
    30  	OS                   string   `protobuf:"bytes,1,opt,name=os,proto3" json:"os,omitempty"`
    31  	Architecture         string   `protobuf:"bytes,2,opt,name=architecture,proto3" json:"architecture,omitempty"`
    32  	Variant              string   `protobuf:"bytes,3,opt,name=variant,proto3" json:"variant,omitempty"`
    33  	XXX_NoUnkeyedLiteral struct{} `json:"-"`
    34  	XXX_unrecognized     []byte   `json:"-"`
    35  	XXX_sizecache        int32    `json:"-"`
    36  }
    37  
    38  func (m *Platform) Reset()      { *m = Platform{} }
    39  func (*Platform) ProtoMessage() {}
    40  func (*Platform) Descriptor() ([]byte, []int) {
    41  	return fileDescriptor_24ba7a4b83e2367e, []int{0}
    42  }
    43  func (m *Platform) XXX_Unmarshal(b []byte) error {
    44  	return m.Unmarshal(b)
    45  }
    46  func (m *Platform) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    47  	if deterministic {
    48  		return xxx_messageInfo_Platform.Marshal(b, m, deterministic)
    49  	} else {
    50  		b = b[:cap(b)]
    51  		n, err := m.MarshalToSizedBuffer(b)
    52  		if err != nil {
    53  			return nil, err
    54  		}
    55  		return b[:n], nil
    56  	}
    57  }
    58  func (m *Platform) XXX_Merge(src proto.Message) {
    59  	xxx_messageInfo_Platform.Merge(m, src)
    60  }
    61  func (m *Platform) XXX_Size() int {
    62  	return m.Size()
    63  }
    64  func (m *Platform) XXX_DiscardUnknown() {
    65  	xxx_messageInfo_Platform.DiscardUnknown(m)
    66  }
    67  
    68  var xxx_messageInfo_Platform proto.InternalMessageInfo
    69  
    70  func init() {
    71  	proto.RegisterType((*Platform)(nil), "containerd.types.Platform")
    72  }
    73  
    74  func init() {
    75  	proto.RegisterFile("github.com/containerd/containerd/api/types/platform.proto", fileDescriptor_24ba7a4b83e2367e)
    76  }
    77  
    78  var fileDescriptor_24ba7a4b83e2367e = []byte{
    79  	// 205 bytes of a gzipped FileDescriptorProto
    80  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4c, 0xcf, 0x2c, 0xc9,
    81  	0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
    82  	0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0x17, 0xe4, 0x24,
    83  	0x96, 0xa4, 0xe5, 0x17, 0xe5, 0xea, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 0x14, 0xe9,
    84  	0x81, 0x15, 0x48, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x25, 0xf5, 0x41, 0x2c, 0x88, 0x3a, 0xa5,
    85  	0x04, 0x2e, 0x8e, 0x00, 0xa8, 0x4e, 0x21, 0x31, 0x2e, 0xa6, 0xfc, 0x62, 0x09, 0x46, 0x05, 0x46,
    86  	0x0d, 0x4e, 0x27, 0xb6, 0x47, 0xf7, 0xe4, 0x99, 0xfc, 0x83, 0x83, 0x98, 0xf2, 0x8b, 0x85, 0x94,
    87  	0xb8, 0x78, 0x12, 0x8b, 0x92, 0x33, 0x32, 0x4b, 0x52, 0x93, 0x4b, 0x4a, 0x8b, 0x52, 0x25, 0x98,
    88  	0x40, 0x2a, 0x82, 0x50, 0xc4, 0x84, 0x24, 0xb8, 0xd8, 0xcb, 0x12, 0x8b, 0x32, 0x13, 0xf3, 0x4a,
    89  	0x24, 0x98, 0xc1, 0xd2, 0x30, 0xae, 0x93, 0xd7, 0x89, 0x87, 0x72, 0x0c, 0x37, 0x1e, 0xca, 0x31,
    90  	0x34, 0x3c, 0x92, 0x63, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4,
    91  	0x18, 0xa3, 0x0c, 0x88, 0xf7, 0x9e, 0x35, 0x98, 0x8c, 0x60, 0x48, 0x62, 0x03, 0x3b, 0xdb, 0x18,
    92  	0x10, 0x00, 0x00, 0xff, 0xff, 0x05, 0xaa, 0xda, 0xa1, 0x1b, 0x01, 0x00, 0x00,
    93  }
    94  
    95  func (m *Platform) Marshal() (dAtA []byte, err error) {
    96  	size := m.Size()
    97  	dAtA = make([]byte, size)
    98  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
    99  	if err != nil {
   100  		return nil, err
   101  	}
   102  	return dAtA[:n], nil
   103  }
   104  
   105  func (m *Platform) MarshalTo(dAtA []byte) (int, error) {
   106  	size := m.Size()
   107  	return m.MarshalToSizedBuffer(dAtA[:size])
   108  }
   109  
   110  func (m *Platform) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   111  	i := len(dAtA)
   112  	_ = i
   113  	var l int
   114  	_ = l
   115  	if m.XXX_unrecognized != nil {
   116  		i -= len(m.XXX_unrecognized)
   117  		copy(dAtA[i:], m.XXX_unrecognized)
   118  	}
   119  	if len(m.Variant) > 0 {
   120  		i -= len(m.Variant)
   121  		copy(dAtA[i:], m.Variant)
   122  		i = encodeVarintPlatform(dAtA, i, uint64(len(m.Variant)))
   123  		i--
   124  		dAtA[i] = 0x1a
   125  	}
   126  	if len(m.Architecture) > 0 {
   127  		i -= len(m.Architecture)
   128  		copy(dAtA[i:], m.Architecture)
   129  		i = encodeVarintPlatform(dAtA, i, uint64(len(m.Architecture)))
   130  		i--
   131  		dAtA[i] = 0x12
   132  	}
   133  	if len(m.OS) > 0 {
   134  		i -= len(m.OS)
   135  		copy(dAtA[i:], m.OS)
   136  		i = encodeVarintPlatform(dAtA, i, uint64(len(m.OS)))
   137  		i--
   138  		dAtA[i] = 0xa
   139  	}
   140  	return len(dAtA) - i, nil
   141  }
   142  
   143  func encodeVarintPlatform(dAtA []byte, offset int, v uint64) int {
   144  	offset -= sovPlatform(v)
   145  	base := offset
   146  	for v >= 1<<7 {
   147  		dAtA[offset] = uint8(v&0x7f | 0x80)
   148  		v >>= 7
   149  		offset++
   150  	}
   151  	dAtA[offset] = uint8(v)
   152  	return base
   153  }
   154  func (m *Platform) Size() (n int) {
   155  	if m == nil {
   156  		return 0
   157  	}
   158  	var l int
   159  	_ = l
   160  	l = len(m.OS)
   161  	if l > 0 {
   162  		n += 1 + l + sovPlatform(uint64(l))
   163  	}
   164  	l = len(m.Architecture)
   165  	if l > 0 {
   166  		n += 1 + l + sovPlatform(uint64(l))
   167  	}
   168  	l = len(m.Variant)
   169  	if l > 0 {
   170  		n += 1 + l + sovPlatform(uint64(l))
   171  	}
   172  	if m.XXX_unrecognized != nil {
   173  		n += len(m.XXX_unrecognized)
   174  	}
   175  	return n
   176  }
   177  
   178  func sovPlatform(x uint64) (n int) {
   179  	return (math_bits.Len64(x|1) + 6) / 7
   180  }
   181  func sozPlatform(x uint64) (n int) {
   182  	return sovPlatform(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   183  }
   184  func (this *Platform) String() string {
   185  	if this == nil {
   186  		return "nil"
   187  	}
   188  	s := strings.Join([]string{`&Platform{`,
   189  		`OS:` + fmt.Sprintf("%v", this.OS) + `,`,
   190  		`Architecture:` + fmt.Sprintf("%v", this.Architecture) + `,`,
   191  		`Variant:` + fmt.Sprintf("%v", this.Variant) + `,`,
   192  		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
   193  		`}`,
   194  	}, "")
   195  	return s
   196  }
   197  func valueToStringPlatform(v interface{}) string {
   198  	rv := reflect.ValueOf(v)
   199  	if rv.IsNil() {
   200  		return "nil"
   201  	}
   202  	pv := reflect.Indirect(rv).Interface()
   203  	return fmt.Sprintf("*%v", pv)
   204  }
   205  func (m *Platform) Unmarshal(dAtA []byte) error {
   206  	l := len(dAtA)
   207  	iNdEx := 0
   208  	for iNdEx < l {
   209  		preIndex := iNdEx
   210  		var wire uint64
   211  		for shift := uint(0); ; shift += 7 {
   212  			if shift >= 64 {
   213  				return ErrIntOverflowPlatform
   214  			}
   215  			if iNdEx >= l {
   216  				return io.ErrUnexpectedEOF
   217  			}
   218  			b := dAtA[iNdEx]
   219  			iNdEx++
   220  			wire |= uint64(b&0x7F) << shift
   221  			if b < 0x80 {
   222  				break
   223  			}
   224  		}
   225  		fieldNum := int32(wire >> 3)
   226  		wireType := int(wire & 0x7)
   227  		if wireType == 4 {
   228  			return fmt.Errorf("proto: Platform: wiretype end group for non-group")
   229  		}
   230  		if fieldNum <= 0 {
   231  			return fmt.Errorf("proto: Platform: illegal tag %d (wire type %d)", fieldNum, wire)
   232  		}
   233  		switch fieldNum {
   234  		case 1:
   235  			if wireType != 2 {
   236  				return fmt.Errorf("proto: wrong wireType = %d for field OS", wireType)
   237  			}
   238  			var stringLen uint64
   239  			for shift := uint(0); ; shift += 7 {
   240  				if shift >= 64 {
   241  					return ErrIntOverflowPlatform
   242  				}
   243  				if iNdEx >= l {
   244  					return io.ErrUnexpectedEOF
   245  				}
   246  				b := dAtA[iNdEx]
   247  				iNdEx++
   248  				stringLen |= uint64(b&0x7F) << shift
   249  				if b < 0x80 {
   250  					break
   251  				}
   252  			}
   253  			intStringLen := int(stringLen)
   254  			if intStringLen < 0 {
   255  				return ErrInvalidLengthPlatform
   256  			}
   257  			postIndex := iNdEx + intStringLen
   258  			if postIndex < 0 {
   259  				return ErrInvalidLengthPlatform
   260  			}
   261  			if postIndex > l {
   262  				return io.ErrUnexpectedEOF
   263  			}
   264  			m.OS = string(dAtA[iNdEx:postIndex])
   265  			iNdEx = postIndex
   266  		case 2:
   267  			if wireType != 2 {
   268  				return fmt.Errorf("proto: wrong wireType = %d for field Architecture", wireType)
   269  			}
   270  			var stringLen uint64
   271  			for shift := uint(0); ; shift += 7 {
   272  				if shift >= 64 {
   273  					return ErrIntOverflowPlatform
   274  				}
   275  				if iNdEx >= l {
   276  					return io.ErrUnexpectedEOF
   277  				}
   278  				b := dAtA[iNdEx]
   279  				iNdEx++
   280  				stringLen |= uint64(b&0x7F) << shift
   281  				if b < 0x80 {
   282  					break
   283  				}
   284  			}
   285  			intStringLen := int(stringLen)
   286  			if intStringLen < 0 {
   287  				return ErrInvalidLengthPlatform
   288  			}
   289  			postIndex := iNdEx + intStringLen
   290  			if postIndex < 0 {
   291  				return ErrInvalidLengthPlatform
   292  			}
   293  			if postIndex > l {
   294  				return io.ErrUnexpectedEOF
   295  			}
   296  			m.Architecture = string(dAtA[iNdEx:postIndex])
   297  			iNdEx = postIndex
   298  		case 3:
   299  			if wireType != 2 {
   300  				return fmt.Errorf("proto: wrong wireType = %d for field Variant", wireType)
   301  			}
   302  			var stringLen uint64
   303  			for shift := uint(0); ; shift += 7 {
   304  				if shift >= 64 {
   305  					return ErrIntOverflowPlatform
   306  				}
   307  				if iNdEx >= l {
   308  					return io.ErrUnexpectedEOF
   309  				}
   310  				b := dAtA[iNdEx]
   311  				iNdEx++
   312  				stringLen |= uint64(b&0x7F) << shift
   313  				if b < 0x80 {
   314  					break
   315  				}
   316  			}
   317  			intStringLen := int(stringLen)
   318  			if intStringLen < 0 {
   319  				return ErrInvalidLengthPlatform
   320  			}
   321  			postIndex := iNdEx + intStringLen
   322  			if postIndex < 0 {
   323  				return ErrInvalidLengthPlatform
   324  			}
   325  			if postIndex > l {
   326  				return io.ErrUnexpectedEOF
   327  			}
   328  			m.Variant = string(dAtA[iNdEx:postIndex])
   329  			iNdEx = postIndex
   330  		default:
   331  			iNdEx = preIndex
   332  			skippy, err := skipPlatform(dAtA[iNdEx:])
   333  			if err != nil {
   334  				return err
   335  			}
   336  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   337  				return ErrInvalidLengthPlatform
   338  			}
   339  			if (iNdEx + skippy) > l {
   340  				return io.ErrUnexpectedEOF
   341  			}
   342  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   343  			iNdEx += skippy
   344  		}
   345  	}
   346  
   347  	if iNdEx > l {
   348  		return io.ErrUnexpectedEOF
   349  	}
   350  	return nil
   351  }
   352  func skipPlatform(dAtA []byte) (n int, err error) {
   353  	l := len(dAtA)
   354  	iNdEx := 0
   355  	depth := 0
   356  	for iNdEx < l {
   357  		var wire uint64
   358  		for shift := uint(0); ; shift += 7 {
   359  			if shift >= 64 {
   360  				return 0, ErrIntOverflowPlatform
   361  			}
   362  			if iNdEx >= l {
   363  				return 0, io.ErrUnexpectedEOF
   364  			}
   365  			b := dAtA[iNdEx]
   366  			iNdEx++
   367  			wire |= (uint64(b) & 0x7F) << shift
   368  			if b < 0x80 {
   369  				break
   370  			}
   371  		}
   372  		wireType := int(wire & 0x7)
   373  		switch wireType {
   374  		case 0:
   375  			for shift := uint(0); ; shift += 7 {
   376  				if shift >= 64 {
   377  					return 0, ErrIntOverflowPlatform
   378  				}
   379  				if iNdEx >= l {
   380  					return 0, io.ErrUnexpectedEOF
   381  				}
   382  				iNdEx++
   383  				if dAtA[iNdEx-1] < 0x80 {
   384  					break
   385  				}
   386  			}
   387  		case 1:
   388  			iNdEx += 8
   389  		case 2:
   390  			var length int
   391  			for shift := uint(0); ; shift += 7 {
   392  				if shift >= 64 {
   393  					return 0, ErrIntOverflowPlatform
   394  				}
   395  				if iNdEx >= l {
   396  					return 0, io.ErrUnexpectedEOF
   397  				}
   398  				b := dAtA[iNdEx]
   399  				iNdEx++
   400  				length |= (int(b) & 0x7F) << shift
   401  				if b < 0x80 {
   402  					break
   403  				}
   404  			}
   405  			if length < 0 {
   406  				return 0, ErrInvalidLengthPlatform
   407  			}
   408  			iNdEx += length
   409  		case 3:
   410  			depth++
   411  		case 4:
   412  			if depth == 0 {
   413  				return 0, ErrUnexpectedEndOfGroupPlatform
   414  			}
   415  			depth--
   416  		case 5:
   417  			iNdEx += 4
   418  		default:
   419  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   420  		}
   421  		if iNdEx < 0 {
   422  			return 0, ErrInvalidLengthPlatform
   423  		}
   424  		if depth == 0 {
   425  			return iNdEx, nil
   426  		}
   427  	}
   428  	return 0, io.ErrUnexpectedEOF
   429  }
   430  
   431  var (
   432  	ErrInvalidLengthPlatform        = fmt.Errorf("proto: negative length found during unmarshaling")
   433  	ErrIntOverflowPlatform          = fmt.Errorf("proto: integer overflow")
   434  	ErrUnexpectedEndOfGroupPlatform = fmt.Errorf("proto: unexpected end of group")
   435  )