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