github.com/containerd/containerd@v22.0.0-20200918172823-438c87b8e050+incompatible/api/types/metrics.pb.go (about)

     1  // Code generated by protoc-gen-gogo. DO NOT EDIT.
     2  // source: github.com/containerd/containerd/api/types/metrics.proto
     3  
     4  package types
     5  
     6  import (
     7  	fmt "fmt"
     8  	proto "github.com/gogo/protobuf/proto"
     9  	github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
    10  	types "github.com/gogo/protobuf/types"
    11  	io "io"
    12  	math "math"
    13  	math_bits "math/bits"
    14  	reflect "reflect"
    15  	strings "strings"
    16  	time "time"
    17  )
    18  
    19  // Reference imports to suppress errors if they are not otherwise used.
    20  var _ = proto.Marshal
    21  var _ = fmt.Errorf
    22  var _ = math.Inf
    23  var _ = time.Kitchen
    24  
    25  // This is a compile-time assertion to ensure that this generated file
    26  // is compatible with the proto package it is being compiled against.
    27  // A compilation error at this line likely means your copy of the
    28  // proto package needs to be updated.
    29  const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
    30  
    31  type Metric struct {
    32  	Timestamp            time.Time  `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
    33  	ID                   string     `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
    34  	Data                 *types.Any `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
    35  	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
    36  	XXX_unrecognized     []byte     `json:"-"`
    37  	XXX_sizecache        int32      `json:"-"`
    38  }
    39  
    40  func (m *Metric) Reset()      { *m = Metric{} }
    41  func (*Metric) ProtoMessage() {}
    42  func (*Metric) Descriptor() ([]byte, []int) {
    43  	return fileDescriptor_8d594d87edf6e6bc, []int{0}
    44  }
    45  func (m *Metric) XXX_Unmarshal(b []byte) error {
    46  	return m.Unmarshal(b)
    47  }
    48  func (m *Metric) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
    49  	if deterministic {
    50  		return xxx_messageInfo_Metric.Marshal(b, m, deterministic)
    51  	} else {
    52  		b = b[:cap(b)]
    53  		n, err := m.MarshalToSizedBuffer(b)
    54  		if err != nil {
    55  			return nil, err
    56  		}
    57  		return b[:n], nil
    58  	}
    59  }
    60  func (m *Metric) XXX_Merge(src proto.Message) {
    61  	xxx_messageInfo_Metric.Merge(m, src)
    62  }
    63  func (m *Metric) XXX_Size() int {
    64  	return m.Size()
    65  }
    66  func (m *Metric) XXX_DiscardUnknown() {
    67  	xxx_messageInfo_Metric.DiscardUnknown(m)
    68  }
    69  
    70  var xxx_messageInfo_Metric proto.InternalMessageInfo
    71  
    72  func init() {
    73  	proto.RegisterType((*Metric)(nil), "containerd.types.Metric")
    74  }
    75  
    76  func init() {
    77  	proto.RegisterFile("github.com/containerd/containerd/api/types/metrics.proto", fileDescriptor_8d594d87edf6e6bc)
    78  }
    79  
    80  var fileDescriptor_8d594d87edf6e6bc = []byte{
    81  	// 258 bytes of a gzipped FileDescriptorProto
    82  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x48, 0xcf, 0x2c, 0xc9,
    83  	0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
    84  	0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xe7, 0xa6, 0x96,
    85  	0x14, 0x65, 0x26, 0x17, 0xeb, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 0xd4, 0xe8, 0x81,
    86  	0xe5, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x92, 0xfa, 0x20, 0x16, 0x44, 0x9d, 0x94, 0x64,
    87  	0x7a, 0x7e, 0x7e, 0x7a, 0x4e, 0xaa, 0x3e, 0x98, 0x97, 0x54, 0x9a, 0xa6, 0x9f, 0x98, 0x57, 0x09,
    88  	0x95, 0x92, 0x47, 0x97, 0x2a, 0xc9, 0xcc, 0x4d, 0x2d, 0x2e, 0x49, 0xcc, 0x2d, 0x80, 0x28, 0x50,
    89  	0xea, 0x63, 0xe4, 0x62, 0xf3, 0x05, 0xdb, 0x2a, 0xe4, 0xc4, 0xc5, 0x09, 0x97, 0x95, 0x60, 0x54,
    90  	0x60, 0xd4, 0xe0, 0x36, 0x92, 0xd2, 0x83, 0xe8, 0xd7, 0x83, 0xe9, 0xd7, 0x0b, 0x81, 0xa9, 0x70,
    91  	0xe2, 0x38, 0x71, 0x4f, 0x9e, 0x61, 0xc2, 0x7d, 0x79, 0xc6, 0x20, 0x84, 0x36, 0x21, 0x31, 0x2e,
    92  	0xa6, 0xcc, 0x14, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0xb6, 0x47, 0xf7, 0xe4, 0x99, 0x3c,
    93  	0x5d, 0x82, 0x98, 0x32, 0x53, 0x84, 0x34, 0xb8, 0x58, 0x52, 0x12, 0x4b, 0x12, 0x25, 0x98, 0xc1,
    94  	0xc6, 0x8a, 0x60, 0x18, 0xeb, 0x98, 0x57, 0x19, 0x04, 0x56, 0xe1, 0xe4, 0x75, 0xe2, 0xa1, 0x1c,
    95  	0xc3, 0x8d, 0x87, 0x72, 0x0c, 0x0d, 0x8f, 0xe4, 0x18, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48,
    96  	0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x28, 0x03, 0xe2, 0x03, 0xd2, 0x1a, 0x4c, 0x46, 0x30, 0x24,
    97  	0xb1, 0x81, 0x6d, 0x30, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0xde, 0x0d, 0x02, 0xfe, 0x85, 0x01,
    98  	0x00, 0x00,
    99  }
   100  
   101  func (m *Metric) Marshal() (dAtA []byte, err error) {
   102  	size := m.Size()
   103  	dAtA = make([]byte, size)
   104  	n, err := m.MarshalToSizedBuffer(dAtA[:size])
   105  	if err != nil {
   106  		return nil, err
   107  	}
   108  	return dAtA[:n], nil
   109  }
   110  
   111  func (m *Metric) MarshalTo(dAtA []byte) (int, error) {
   112  	size := m.Size()
   113  	return m.MarshalToSizedBuffer(dAtA[:size])
   114  }
   115  
   116  func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) {
   117  	i := len(dAtA)
   118  	_ = i
   119  	var l int
   120  	_ = l
   121  	if m.XXX_unrecognized != nil {
   122  		i -= len(m.XXX_unrecognized)
   123  		copy(dAtA[i:], m.XXX_unrecognized)
   124  	}
   125  	if m.Data != nil {
   126  		{
   127  			size, err := m.Data.MarshalToSizedBuffer(dAtA[:i])
   128  			if err != nil {
   129  				return 0, err
   130  			}
   131  			i -= size
   132  			i = encodeVarintMetrics(dAtA, i, uint64(size))
   133  		}
   134  		i--
   135  		dAtA[i] = 0x1a
   136  	}
   137  	if len(m.ID) > 0 {
   138  		i -= len(m.ID)
   139  		copy(dAtA[i:], m.ID)
   140  		i = encodeVarintMetrics(dAtA, i, uint64(len(m.ID)))
   141  		i--
   142  		dAtA[i] = 0x12
   143  	}
   144  	n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):])
   145  	if err2 != nil {
   146  		return 0, err2
   147  	}
   148  	i -= n2
   149  	i = encodeVarintMetrics(dAtA, i, uint64(n2))
   150  	i--
   151  	dAtA[i] = 0xa
   152  	return len(dAtA) - i, nil
   153  }
   154  
   155  func encodeVarintMetrics(dAtA []byte, offset int, v uint64) int {
   156  	offset -= sovMetrics(v)
   157  	base := offset
   158  	for v >= 1<<7 {
   159  		dAtA[offset] = uint8(v&0x7f | 0x80)
   160  		v >>= 7
   161  		offset++
   162  	}
   163  	dAtA[offset] = uint8(v)
   164  	return base
   165  }
   166  func (m *Metric) Size() (n int) {
   167  	if m == nil {
   168  		return 0
   169  	}
   170  	var l int
   171  	_ = l
   172  	l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
   173  	n += 1 + l + sovMetrics(uint64(l))
   174  	l = len(m.ID)
   175  	if l > 0 {
   176  		n += 1 + l + sovMetrics(uint64(l))
   177  	}
   178  	if m.Data != nil {
   179  		l = m.Data.Size()
   180  		n += 1 + l + sovMetrics(uint64(l))
   181  	}
   182  	if m.XXX_unrecognized != nil {
   183  		n += len(m.XXX_unrecognized)
   184  	}
   185  	return n
   186  }
   187  
   188  func sovMetrics(x uint64) (n int) {
   189  	return (math_bits.Len64(x|1) + 6) / 7
   190  }
   191  func sozMetrics(x uint64) (n int) {
   192  	return sovMetrics(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   193  }
   194  func (this *Metric) String() string {
   195  	if this == nil {
   196  		return "nil"
   197  	}
   198  	s := strings.Join([]string{`&Metric{`,
   199  		`Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
   200  		`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
   201  		`Data:` + strings.Replace(fmt.Sprintf("%v", this.Data), "Any", "types.Any", 1) + `,`,
   202  		`XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`,
   203  		`}`,
   204  	}, "")
   205  	return s
   206  }
   207  func valueToStringMetrics(v interface{}) string {
   208  	rv := reflect.ValueOf(v)
   209  	if rv.IsNil() {
   210  		return "nil"
   211  	}
   212  	pv := reflect.Indirect(rv).Interface()
   213  	return fmt.Sprintf("*%v", pv)
   214  }
   215  func (m *Metric) Unmarshal(dAtA []byte) error {
   216  	l := len(dAtA)
   217  	iNdEx := 0
   218  	for iNdEx < l {
   219  		preIndex := iNdEx
   220  		var wire uint64
   221  		for shift := uint(0); ; shift += 7 {
   222  			if shift >= 64 {
   223  				return ErrIntOverflowMetrics
   224  			}
   225  			if iNdEx >= l {
   226  				return io.ErrUnexpectedEOF
   227  			}
   228  			b := dAtA[iNdEx]
   229  			iNdEx++
   230  			wire |= uint64(b&0x7F) << shift
   231  			if b < 0x80 {
   232  				break
   233  			}
   234  		}
   235  		fieldNum := int32(wire >> 3)
   236  		wireType := int(wire & 0x7)
   237  		if wireType == 4 {
   238  			return fmt.Errorf("proto: Metric: wiretype end group for non-group")
   239  		}
   240  		if fieldNum <= 0 {
   241  			return fmt.Errorf("proto: Metric: illegal tag %d (wire type %d)", fieldNum, wire)
   242  		}
   243  		switch fieldNum {
   244  		case 1:
   245  			if wireType != 2 {
   246  				return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
   247  			}
   248  			var msglen int
   249  			for shift := uint(0); ; shift += 7 {
   250  				if shift >= 64 {
   251  					return ErrIntOverflowMetrics
   252  				}
   253  				if iNdEx >= l {
   254  					return io.ErrUnexpectedEOF
   255  				}
   256  				b := dAtA[iNdEx]
   257  				iNdEx++
   258  				msglen |= int(b&0x7F) << shift
   259  				if b < 0x80 {
   260  					break
   261  				}
   262  			}
   263  			if msglen < 0 {
   264  				return ErrInvalidLengthMetrics
   265  			}
   266  			postIndex := iNdEx + msglen
   267  			if postIndex < 0 {
   268  				return ErrInvalidLengthMetrics
   269  			}
   270  			if postIndex > l {
   271  				return io.ErrUnexpectedEOF
   272  			}
   273  			if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
   274  				return err
   275  			}
   276  			iNdEx = postIndex
   277  		case 2:
   278  			if wireType != 2 {
   279  				return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
   280  			}
   281  			var stringLen uint64
   282  			for shift := uint(0); ; shift += 7 {
   283  				if shift >= 64 {
   284  					return ErrIntOverflowMetrics
   285  				}
   286  				if iNdEx >= l {
   287  					return io.ErrUnexpectedEOF
   288  				}
   289  				b := dAtA[iNdEx]
   290  				iNdEx++
   291  				stringLen |= uint64(b&0x7F) << shift
   292  				if b < 0x80 {
   293  					break
   294  				}
   295  			}
   296  			intStringLen := int(stringLen)
   297  			if intStringLen < 0 {
   298  				return ErrInvalidLengthMetrics
   299  			}
   300  			postIndex := iNdEx + intStringLen
   301  			if postIndex < 0 {
   302  				return ErrInvalidLengthMetrics
   303  			}
   304  			if postIndex > l {
   305  				return io.ErrUnexpectedEOF
   306  			}
   307  			m.ID = string(dAtA[iNdEx:postIndex])
   308  			iNdEx = postIndex
   309  		case 3:
   310  			if wireType != 2 {
   311  				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
   312  			}
   313  			var msglen int
   314  			for shift := uint(0); ; shift += 7 {
   315  				if shift >= 64 {
   316  					return ErrIntOverflowMetrics
   317  				}
   318  				if iNdEx >= l {
   319  					return io.ErrUnexpectedEOF
   320  				}
   321  				b := dAtA[iNdEx]
   322  				iNdEx++
   323  				msglen |= int(b&0x7F) << shift
   324  				if b < 0x80 {
   325  					break
   326  				}
   327  			}
   328  			if msglen < 0 {
   329  				return ErrInvalidLengthMetrics
   330  			}
   331  			postIndex := iNdEx + msglen
   332  			if postIndex < 0 {
   333  				return ErrInvalidLengthMetrics
   334  			}
   335  			if postIndex > l {
   336  				return io.ErrUnexpectedEOF
   337  			}
   338  			if m.Data == nil {
   339  				m.Data = &types.Any{}
   340  			}
   341  			if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
   342  				return err
   343  			}
   344  			iNdEx = postIndex
   345  		default:
   346  			iNdEx = preIndex
   347  			skippy, err := skipMetrics(dAtA[iNdEx:])
   348  			if err != nil {
   349  				return err
   350  			}
   351  			if skippy < 0 {
   352  				return ErrInvalidLengthMetrics
   353  			}
   354  			if (iNdEx + skippy) < 0 {
   355  				return ErrInvalidLengthMetrics
   356  			}
   357  			if (iNdEx + skippy) > l {
   358  				return io.ErrUnexpectedEOF
   359  			}
   360  			m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
   361  			iNdEx += skippy
   362  		}
   363  	}
   364  
   365  	if iNdEx > l {
   366  		return io.ErrUnexpectedEOF
   367  	}
   368  	return nil
   369  }
   370  func skipMetrics(dAtA []byte) (n int, err error) {
   371  	l := len(dAtA)
   372  	iNdEx := 0
   373  	depth := 0
   374  	for iNdEx < l {
   375  		var wire uint64
   376  		for shift := uint(0); ; shift += 7 {
   377  			if shift >= 64 {
   378  				return 0, ErrIntOverflowMetrics
   379  			}
   380  			if iNdEx >= l {
   381  				return 0, io.ErrUnexpectedEOF
   382  			}
   383  			b := dAtA[iNdEx]
   384  			iNdEx++
   385  			wire |= (uint64(b) & 0x7F) << shift
   386  			if b < 0x80 {
   387  				break
   388  			}
   389  		}
   390  		wireType := int(wire & 0x7)
   391  		switch wireType {
   392  		case 0:
   393  			for shift := uint(0); ; shift += 7 {
   394  				if shift >= 64 {
   395  					return 0, ErrIntOverflowMetrics
   396  				}
   397  				if iNdEx >= l {
   398  					return 0, io.ErrUnexpectedEOF
   399  				}
   400  				iNdEx++
   401  				if dAtA[iNdEx-1] < 0x80 {
   402  					break
   403  				}
   404  			}
   405  		case 1:
   406  			iNdEx += 8
   407  		case 2:
   408  			var length int
   409  			for shift := uint(0); ; shift += 7 {
   410  				if shift >= 64 {
   411  					return 0, ErrIntOverflowMetrics
   412  				}
   413  				if iNdEx >= l {
   414  					return 0, io.ErrUnexpectedEOF
   415  				}
   416  				b := dAtA[iNdEx]
   417  				iNdEx++
   418  				length |= (int(b) & 0x7F) << shift
   419  				if b < 0x80 {
   420  					break
   421  				}
   422  			}
   423  			if length < 0 {
   424  				return 0, ErrInvalidLengthMetrics
   425  			}
   426  			iNdEx += length
   427  		case 3:
   428  			depth++
   429  		case 4:
   430  			if depth == 0 {
   431  				return 0, ErrUnexpectedEndOfGroupMetrics
   432  			}
   433  			depth--
   434  		case 5:
   435  			iNdEx += 4
   436  		default:
   437  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   438  		}
   439  		if iNdEx < 0 {
   440  			return 0, ErrInvalidLengthMetrics
   441  		}
   442  		if depth == 0 {
   443  			return iNdEx, nil
   444  		}
   445  	}
   446  	return 0, io.ErrUnexpectedEOF
   447  }
   448  
   449  var (
   450  	ErrInvalidLengthMetrics        = fmt.Errorf("proto: negative length found during unmarshaling")
   451  	ErrIntOverflowMetrics          = fmt.Errorf("proto: integer overflow")
   452  	ErrUnexpectedEndOfGroupMetrics = fmt.Errorf("proto: unexpected end of group")
   453  )