pkg/protocol/metric_event.pb.go (745 lines of code) (raw):

// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: metric_event.proto package protocol import ( encoding_binary "encoding/binary" fmt "fmt" proto "github.com/gogo/protobuf/proto" io "io" math "math" math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type UntypedSingleValue struct { Value float64 `protobuf:"fixed64,1,opt,name=Value,proto3" json:"Value,omitempty"` } func (m *UntypedSingleValue) Reset() { *m = UntypedSingleValue{} } func (m *UntypedSingleValue) String() string { return proto.CompactTextString(m) } func (*UntypedSingleValue) ProtoMessage() {} func (*UntypedSingleValue) Descriptor() ([]byte, []int) { return fileDescriptor_7e0c5b3c1d4100c7, []int{0} } func (m *UntypedSingleValue) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *UntypedSingleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_UntypedSingleValue.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *UntypedSingleValue) XXX_Merge(src proto.Message) { xxx_messageInfo_UntypedSingleValue.Merge(m, src) } func (m *UntypedSingleValue) XXX_Size() int { return m.Size() } func (m *UntypedSingleValue) XXX_DiscardUnknown() { xxx_messageInfo_UntypedSingleValue.DiscardUnknown(m) } var xxx_messageInfo_UntypedSingleValue proto.InternalMessageInfo func (m *UntypedSingleValue) GetValue() float64 { if m != nil { return m.Value } return 0 } type MetricEvent struct { Timestamp uint64 `protobuf:"varint,1,opt,name=Timestamp,proto3" json:"Timestamp,omitempty"` Name []byte `protobuf:"bytes,2,opt,name=Name,proto3" json:"Name,omitempty"` Tags map[string][]byte `protobuf:"bytes,3,rep,name=Tags,proto3" json:"Tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Types that are valid to be assigned to Value: // // *MetricEvent_UntypedSingleValue Value isMetricEvent_Value `protobuf_oneof:"Value"` } func (m *MetricEvent) Reset() { *m = MetricEvent{} } func (m *MetricEvent) String() string { return proto.CompactTextString(m) } func (*MetricEvent) ProtoMessage() {} func (*MetricEvent) Descriptor() ([]byte, []int) { return fileDescriptor_7e0c5b3c1d4100c7, []int{1} } func (m *MetricEvent) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *MetricEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MetricEvent.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } return b[:n], nil } } func (m *MetricEvent) XXX_Merge(src proto.Message) { xxx_messageInfo_MetricEvent.Merge(m, src) } func (m *MetricEvent) XXX_Size() int { return m.Size() } func (m *MetricEvent) XXX_DiscardUnknown() { xxx_messageInfo_MetricEvent.DiscardUnknown(m) } var xxx_messageInfo_MetricEvent proto.InternalMessageInfo type isMetricEvent_Value interface { isMetricEvent_Value() MarshalTo([]byte) (int, error) Size() int } type MetricEvent_UntypedSingleValue struct { UntypedSingleValue *UntypedSingleValue `protobuf:"bytes,4,opt,name=UntypedSingleValue,proto3,oneof" json:"UntypedSingleValue,omitempty"` } func (*MetricEvent_UntypedSingleValue) isMetricEvent_Value() {} func (m *MetricEvent) GetValue() isMetricEvent_Value { if m != nil { return m.Value } return nil } func (m *MetricEvent) GetTimestamp() uint64 { if m != nil { return m.Timestamp } return 0 } func (m *MetricEvent) GetName() []byte { if m != nil { return m.Name } return nil } func (m *MetricEvent) GetTags() map[string][]byte { if m != nil { return m.Tags } return nil } func (m *MetricEvent) GetUntypedSingleValue() *UntypedSingleValue { if x, ok := m.GetValue().(*MetricEvent_UntypedSingleValue); ok { return x.UntypedSingleValue } return nil } // XXX_OneofWrappers is for the internal use of the proto package. func (*MetricEvent) XXX_OneofWrappers() []interface{} { return []interface{}{ (*MetricEvent_UntypedSingleValue)(nil), } } func init() { proto.RegisterType((*UntypedSingleValue)(nil), "logtail.models.UntypedSingleValue") proto.RegisterType((*MetricEvent)(nil), "logtail.models.MetricEvent") proto.RegisterMapType((map[string][]byte)(nil), "logtail.models.MetricEvent.TagsEntry") } func init() { proto.RegisterFile("metric_event.proto", fileDescriptor_7e0c5b3c1d4100c7) } var fileDescriptor_7e0c5b3c1d4100c7 = []byte{ // 269 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xca, 0x4d, 0x2d, 0x29, 0xca, 0x4c, 0x8e, 0x4f, 0x2d, 0x4b, 0xcd, 0x2b, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcb, 0xc9, 0x4f, 0x2f, 0x49, 0xcc, 0xcc, 0xd1, 0xcb, 0xcd, 0x4f, 0x49, 0xcd, 0x29, 0x56, 0xd2, 0xe2, 0x12, 0x0a, 0xcd, 0x2b, 0xa9, 0x2c, 0x48, 0x4d, 0x09, 0xce, 0xcc, 0x4b, 0xcf, 0x49, 0x0d, 0x4b, 0xcc, 0x29, 0x4d, 0x15, 0x12, 0xe1, 0x62, 0x05, 0x33, 0x24, 0x18, 0x15, 0x18, 0x35, 0x18, 0x83, 0x20, 0x1c, 0xa5, 0x49, 0x4c, 0x5c, 0xdc, 0xbe, 0x60, 0x23, 0x5d, 0x41, 0x26, 0x0a, 0xc9, 0x70, 0x71, 0x86, 0x64, 0xe6, 0xa6, 0x16, 0x97, 0x24, 0xe6, 0x16, 0x80, 0x55, 0xb2, 0x04, 0x21, 0x04, 0x84, 0x84, 0xb8, 0x58, 0xfc, 0x12, 0x73, 0x53, 0x25, 0x98, 0x14, 0x18, 0x35, 0x78, 0x82, 0xc0, 0x6c, 0x21, 0x4b, 0x2e, 0x96, 0x90, 0xc4, 0xf4, 0x62, 0x09, 0x66, 0x05, 0x66, 0x0d, 0x6e, 0x23, 0x55, 0x3d, 0x54, 0xc7, 0xe8, 0x21, 0x19, 0xae, 0x07, 0x52, 0xe7, 0x9a, 0x57, 0x52, 0x54, 0x19, 0x04, 0xd6, 0x22, 0x14, 0x82, 0xcd, 0xa1, 0x12, 0x2c, 0x0a, 0x8c, 0x1a, 0xdc, 0x46, 0x4a, 0xe8, 0x06, 0x61, 0xaa, 0xf4, 0x60, 0x08, 0xc2, 0xa2, 0x5f, 0xca, 0x9c, 0x8b, 0x13, 0x6e, 0x91, 0x90, 0x00, 0x17, 0x73, 0x76, 0x6a, 0x25, 0xd8, 0x27, 0x9c, 0x41, 0x20, 0x26, 0x28, 0x1c, 0xca, 0xc0, 0xf6, 0x40, 0x3c, 0x01, 0xe1, 0x58, 0x31, 0x59, 0x30, 0x3a, 0xb1, 0x43, 0x43, 0xc8, 0x49, 0xe2, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0x92, 0xd8, 0xc0, 0x21, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x8c, 0xec, 0xc0, 0x87, 0x01, 0x00, 0x00, } func (m *UntypedSingleValue) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *UntypedSingleValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *UntypedSingleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Value != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) i-- dAtA[i] = 0x9 } return len(dAtA) - i, nil } func (m *MetricEvent) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } return dAtA[:n], nil } func (m *MetricEvent) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MetricEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if m.Value != nil { { size := m.Value.Size() i -= size if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil { return 0, err } } } if len(m.Tags) > 0 { for k := range m.Tags { v := m.Tags[k] baseI := i if len(v) > 0 { i -= len(v) copy(dAtA[i:], v) i = encodeVarintMetricEvent(dAtA, i, uint64(len(v))) i-- dAtA[i] = 0x12 } i -= len(k) copy(dAtA[i:], k) i = encodeVarintMetricEvent(dAtA, i, uint64(len(k))) i-- dAtA[i] = 0xa i = encodeVarintMetricEvent(dAtA, i, uint64(baseI-i)) i-- dAtA[i] = 0x1a } } if len(m.Name) > 0 { i -= len(m.Name) copy(dAtA[i:], m.Name) i = encodeVarintMetricEvent(dAtA, i, uint64(len(m.Name))) i-- dAtA[i] = 0x12 } if m.Timestamp != 0 { i = encodeVarintMetricEvent(dAtA, i, uint64(m.Timestamp)) i-- dAtA[i] = 0x8 } return len(dAtA) - i, nil } func (m *MetricEvent_UntypedSingleValue) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *MetricEvent_UntypedSingleValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UntypedSingleValue != nil { { size, err := m.UntypedSingleValue.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintMetricEvent(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } return len(dAtA) - i, nil } func encodeVarintMetricEvent(dAtA []byte, offset int, v uint64) int { offset -= sovMetricEvent(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *UntypedSingleValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Value != 0 { n += 9 } return n } func (m *MetricEvent) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.Timestamp != 0 { n += 1 + sovMetricEvent(uint64(m.Timestamp)) } l = len(m.Name) if l > 0 { n += 1 + l + sovMetricEvent(uint64(l)) } if len(m.Tags) > 0 { for k, v := range m.Tags { _ = k _ = v l = 0 if len(v) > 0 { l = 1 + len(v) + sovMetricEvent(uint64(len(v))) } mapEntrySize := 1 + len(k) + sovMetricEvent(uint64(len(k))) + l n += mapEntrySize + 1 + sovMetricEvent(uint64(mapEntrySize)) } } if m.Value != nil { n += m.Value.Size() } return n } func (m *MetricEvent_UntypedSingleValue) Size() (n int) { if m == nil { return 0 } var l int _ = l if m.UntypedSingleValue != nil { l = m.UntypedSingleValue.Size() n += 1 + l + sovMetricEvent(uint64(l)) } return n } func sovMetricEvent(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozMetricEvent(x uint64) (n int) { return sovMetricEvent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *UntypedSingleValue) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetricEvent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: UntypedSingleValue: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: UntypedSingleValue: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var v uint64 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.Value = float64(math.Float64frombits(v)) default: iNdEx = preIndex skippy, err := skipMetricEvent(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricEvent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *MetricEvent) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { preIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetricEvent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { return fmt.Errorf("proto: MetricEvent: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: MetricEvent: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } m.Timestamp = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetricEvent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Timestamp |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetricEvent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthMetricEvent } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthMetricEvent } if postIndex > l { return io.ErrUnexpectedEOF } m.Name = append(m.Name[:0], dAtA[iNdEx:postIndex]...) if m.Name == nil { m.Name = []byte{} } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetricEvent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthMetricEvent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthMetricEvent } if postIndex > l { return io.ErrUnexpectedEOF } if m.Tags == nil { m.Tags = make(map[string][]byte) } var mapkey string mapvalue := []byte{} for iNdEx < postIndex { entryPreIndex := iNdEx var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetricEvent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= uint64(b&0x7F) << shift if b < 0x80 { break } } fieldNum := int32(wire >> 3) if fieldNum == 1 { var stringLenmapkey uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetricEvent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLenmapkey |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLenmapkey := int(stringLenmapkey) if intStringLenmapkey < 0 { return ErrInvalidLengthMetricEvent } postStringIndexmapkey := iNdEx + intStringLenmapkey if postStringIndexmapkey < 0 { return ErrInvalidLengthMetricEvent } if postStringIndexmapkey > l { return io.ErrUnexpectedEOF } mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) iNdEx = postStringIndexmapkey } else if fieldNum == 2 { var mapbyteLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetricEvent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ mapbyteLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intMapbyteLen := int(mapbyteLen) if intMapbyteLen < 0 { return ErrInvalidLengthMetricEvent } postbytesIndex := iNdEx + intMapbyteLen if postbytesIndex < 0 { return ErrInvalidLengthMetricEvent } if postbytesIndex > l { return io.ErrUnexpectedEOF } mapvalue = make([]byte, mapbyteLen) copy(mapvalue, dAtA[iNdEx:postbytesIndex]) iNdEx = postbytesIndex } else { iNdEx = entryPreIndex skippy, err := skipMetricEvent(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricEvent } if (iNdEx + skippy) > postIndex { return io.ErrUnexpectedEOF } iNdEx += skippy } } m.Tags[mapkey] = mapvalue iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UntypedSingleValue", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetricEvent } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthMetricEvent } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthMetricEvent } if postIndex > l { return io.ErrUnexpectedEOF } v := &UntypedSingleValue{} if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } m.Value = &MetricEvent_UntypedSingleValue{v} iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMetricEvent(dAtA[iNdEx:]) if err != nil { return err } if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthMetricEvent } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipMetricEvent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowMetricEvent } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ wire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } wireType := int(wire & 0x7) switch wireType { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowMetricEvent } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } case 1: iNdEx += 8 case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowMetricEvent } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ length |= (int(b) & 0x7F) << shift if b < 0x80 { break } } if length < 0 { return 0, ErrInvalidLengthMetricEvent } iNdEx += length case 3: depth++ case 4: if depth == 0 { return 0, ErrUnexpectedEndOfGroupMetricEvent } depth-- case 5: iNdEx += 4 default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } if iNdEx < 0 { return 0, ErrInvalidLengthMetricEvent } if depth == 0 { return iNdEx, nil } } return 0, io.ErrUnexpectedEOF } var ( ErrInvalidLengthMetricEvent = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMetricEvent = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupMetricEvent = fmt.Errorf("proto: unexpected end of group") )