// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: pkg/ingester/checkpoint.proto package ingester import ( bytes "bytes" fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "github.com/grafana/loki/v3/pkg/logproto" github_com_grafana_loki_v3_pkg_logproto "github.com/grafana/loki/v3/pkg/logproto" io "io" math "math" math_bits "math/bits" reflect "reflect" strings "strings" time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf var _ = time.Kitchen // 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 // Chunk is a {de,}serializable intermediate type for chunkDesc which allows // efficient loading/unloading to disk during WAL checkpoint recovery. type Chunk struct { From time.Time `protobuf:"bytes,1,opt,name=from,proto3,stdtime" json:"from"` To time.Time `protobuf:"bytes,2,opt,name=to,proto3,stdtime" json:"to"` FlushedAt time.Time `protobuf:"bytes,3,opt,name=flushedAt,proto3,stdtime" json:"flushedAt"` LastUpdated time.Time `protobuf:"bytes,4,opt,name=lastUpdated,proto3,stdtime" json:"lastUpdated"` Closed bool `protobuf:"varint,5,opt,name=closed,proto3" json:"closed,omitempty"` Synced bool `protobuf:"varint,6,opt,name=synced,proto3" json:"synced,omitempty"` // data to be unmarshaled into a MemChunk Data []byte `protobuf:"bytes,7,opt,name=data,proto3" json:"data,omitempty"` // data to be unmarshaled into a MemChunk's headBlock Head []byte `protobuf:"bytes,8,opt,name=head,proto3" json:"head,omitempty"` } func (m *Chunk) Reset() { *m = Chunk{} } func (*Chunk) ProtoMessage() {} func (*Chunk) Descriptor() ([]byte, []int) { return fileDescriptor_00f4b7152db9bdb5, []int{0} } func (m *Chunk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Chunk.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 *Chunk) XXX_Merge(src proto.Message) { xxx_messageInfo_Chunk.Merge(m, src) } func (m *Chunk) XXX_Size() int { return m.Size() } func (m *Chunk) XXX_DiscardUnknown() { xxx_messageInfo_Chunk.DiscardUnknown(m) } var xxx_messageInfo_Chunk proto.InternalMessageInfo func (m *Chunk) GetFrom() time.Time { if m != nil { return m.From } return time.Time{} } func (m *Chunk) GetTo() time.Time { if m != nil { return m.To } return time.Time{} } func (m *Chunk) GetFlushedAt() time.Time { if m != nil { return m.FlushedAt } return time.Time{} } func (m *Chunk) GetLastUpdated() time.Time { if m != nil { return m.LastUpdated } return time.Time{} } func (m *Chunk) GetClosed() bool { if m != nil { return m.Closed } return false } func (m *Chunk) GetSynced() bool { if m != nil { return m.Synced } return false } func (m *Chunk) GetData() []byte { if m != nil { return m.Data } return nil } func (m *Chunk) GetHead() []byte { if m != nil { return m.Head } return nil } // Series is a {de,}serializable intermediate type for Series. type Series struct { UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID,omitempty"` // post mapped fingerprint is necessary because subsequent wal writes will reference it. Fingerprint uint64 `protobuf:"varint,2,opt,name=fingerprint,proto3" json:"fingerprint,omitempty"` Labels []github_com_grafana_loki_v3_pkg_logproto.LabelAdapter `protobuf:"bytes,3,rep,name=labels,proto3,customtype=github.com/grafana/loki/v3/pkg/logproto.LabelAdapter" json:"labels"` Chunks []Chunk `protobuf:"bytes,4,rep,name=chunks,proto3" json:"chunks"` // most recently pushed timestamp. To time.Time `protobuf:"bytes,5,opt,name=to,proto3,stdtime" json:"to"` // most recently pushed line. LastLine string `protobuf:"bytes,6,opt,name=lastLine,proto3" json:"lastLine,omitempty"` // highest counter value for pushes to this stream. // Used to skip already applied entries during WAL replay. EntryCt int64 `protobuf:"varint,7,opt,name=entryCt,proto3" json:"entryCt,omitempty"` // highest timestamp pushed to this stream. HighestTs time.Time `protobuf:"bytes,8,opt,name=highestTs,proto3,stdtime" json:"highestTs"` } func (m *Series) Reset() { *m = Series{} } func (*Series) ProtoMessage() {} func (*Series) Descriptor() ([]byte, []int) { return fileDescriptor_00f4b7152db9bdb5, []int{1} } func (m *Series) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *Series) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Series.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 *Series) XXX_Merge(src proto.Message) { xxx_messageInfo_Series.Merge(m, src) } func (m *Series) XXX_Size() int { return m.Size() } func (m *Series) XXX_DiscardUnknown() { xxx_messageInfo_Series.DiscardUnknown(m) } var xxx_messageInfo_Series proto.InternalMessageInfo func (m *Series) GetUserID() string { if m != nil { return m.UserID } return "" } func (m *Series) GetFingerprint() uint64 { if m != nil { return m.Fingerprint } return 0 } func (m *Series) GetChunks() []Chunk { if m != nil { return m.Chunks } return nil } func (m *Series) GetTo() time.Time { if m != nil { return m.To } return time.Time{} } func (m *Series) GetLastLine() string { if m != nil { return m.LastLine } return "" } func (m *Series) GetEntryCt() int64 { if m != nil { return m.EntryCt } return 0 } func (m *Series) GetHighestTs() time.Time { if m != nil { return m.HighestTs } return time.Time{} } func init() { proto.RegisterType((*Chunk)(nil), "loki_ingester.Chunk") proto.RegisterType((*Series)(nil), "loki_ingester.Series") } func init() { proto.RegisterFile("pkg/ingester/checkpoint.proto", fileDescriptor_00f4b7152db9bdb5) } var fileDescriptor_00f4b7152db9bdb5 = []byte{ // 521 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x52, 0x31, 0x8f, 0xd3, 0x30, 0x14, 0x8e, 0xdb,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a0, 0x11, 0xf4, 0x22, 0x13, 0x09, 0x85, 0x5d, 0x2b, 0x78, 0xea, 0xff, 0x93, 0x43, 0xdf, 0xe6, 0x65, 0xec, 0x1a, 0xad, 0xb0, 0x7e, 0x59, 0x67, 0xe0, 0xe8, 0xc0, 0x0c, 0xf4, 0x60, 0xc7, 0x9c, 0x61, 0x92, 0xe6, 0xcc, 0x3a, 0x7c, 0x12, 0xee, 0x30, 0xc2, 0xf0, 0x98, 0xe5, 0x5a, 0xae, 0xae, 0xb4, 0xb5, 0xb9, 0x1d, 0x36, 0xd0, 0x24, 0x27, 0x49, 0x79, 0xc2, 0x94, 0xbe, 0x56, 0xd6, 0xee, 0xff, 0x4e, 0xce, 0x8e, 0x36, 0x7e, 0xb5, 0xde, 0x10, 0xe7, 0x6e, 0x43, 0x9c, 0x87, 0x0d, 0x01, 0x5f, 0x4a, 0x02, 0xbe, 0x95, 0x04, 0xdc, 0x96, 0x04, 0xac, 0x4b, 0x02, 0x7e, 0x95, 0x04, 0xfc, 0x2e, 0x89, 0xf3, 0x50, 0x12, 0x70, 0xb3, 0x25, 0xce, 0x7a, 0x4b, 0x9c, 0xbb, 0x2d, 0x71, 0x3e, 0x76, 0x1a, 0x0f, 0xa6, 0x9e, 0x15, 0x3a, 0xff, 0x13, 0x00, 0x00, 0xff, 0xff, 0x4e, 0xf6, 0xfc, 0x95, 0xc2, 0x03, 0x00, 0x00, } func (this *Chunk) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Chunk) if !ok { that2, ok := that.(Chunk) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if !this.From.Equal(that1.From) { return false } if !this.To.Equal(that1.To) { return false } if !this.FlushedAt.Equal(that1.FlushedAt) { return false } if !this.LastUpdated.Equal(that1.LastUpdated) { return false } if this.Closed != that1.Closed { return false } if this.Synced != that1.Synced { return false } if !bytes.Equal(this.Data, that1.Data) { return false } if !bytes.Equal(this.Head, that1.Head) { return false } return true } func (this *Series) Equal(that interface{}) bool { if that == nil { return this == nil } that1, ok := that.(*Series) if !ok { that2, ok := that.(Series) if ok { that1 = &that2 } else { return false } } if that1 == nil { return this == nil } else if this == nil { return false } if this.UserID != that1.UserID { return false } if this.Fingerprint != that1.Fingerprint { return false } if len(this.Labels) != len(that1.Labels) { return false } for i := range this.Labels { if !this.Labels[i].Equal(that1.Labels[i]) { return false } } if len(this.Chunks) != len(that1.Chunks) { return false } for i := range this.Chunks { if !this.Chunks[i].Equal(&that1.Chunks[i]) { return false } } if !this.To.Equal(that1.To) { return false } if this.LastLine != that1.LastLine { return false } if this.EntryCt != that1.EntryCt { return false } if !this.HighestTs.Equal(that1.HighestTs) { return false } return true } func (this *Chunk) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 12) s = append(s, "&ingester.Chunk{") s = append(s, "From: "+fmt.Sprintf("%#v", this.From)+",\n") s = append(s, "To: "+fmt.Sprintf("%#v", this.To)+",\n") s = append(s, "FlushedAt: "+fmt.Sprintf("%#v", this.FlushedAt)+",\n") s = append(s, "LastUpdated: "+fmt.Sprintf("%#v", this.LastUpdated)+",\n") s = append(s, "Closed: "+fmt.Sprintf("%#v", this.Closed)+",\n") s = append(s, "Synced: "+fmt.Sprintf("%#v", this.Synced)+",\n") s = append(s, "Data: "+fmt.Sprintf("%#v", this.Data)+",\n") s = append(s, "Head: "+fmt.Sprintf("%#v", this.Head)+",\n") s = append(s, "}") return strings.Join(s, "") } func (this *Series) GoString() string { if this == nil { return "nil" } s := make([]string, 0, 12) s = append(s, "&ingester.Series{") s = append(s, "UserID: "+fmt.Sprintf("%#v", this.UserID)+",\n") s = append(s, "Fingerprint: "+fmt.Sprintf("%#v", this.Fingerprint)+",\n") s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") if this.Chunks != nil { vs := make([]*Chunk, len(this.Chunks)) for i := range vs { vs[i] = &this.Chunks[i] } s = append(s, "Chunks: "+fmt.Sprintf("%#v", vs)+",\n") } s = append(s, "To: "+fmt.Sprintf("%#v", this.To)+",\n") s = append(s, "LastLine: "+fmt.Sprintf("%#v", this.LastLine)+",\n") s = append(s, "EntryCt: "+fmt.Sprintf("%#v", this.EntryCt)+",\n") s = append(s, "HighestTs: "+fmt.Sprintf("%#v", this.HighestTs)+",\n") s = append(s, "}") return strings.Join(s, "") } func valueToGoStringCheckpoint(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) } func (m *Chunk) 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 *Chunk) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Chunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l if len(m.Head) > 0 { i -= len(m.Head) copy(dAtA[i:], m.Head) i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.Head))) i-- dAtA[i] = 0x42 } if len(m.Data) > 0 { i -= len(m.Data) copy(dAtA[i:], m.Data) i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.Data))) i-- dAtA[i] = 0x3a } if m.Synced { i-- if m.Synced { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x30 } if m.Closed { i-- if m.Closed { dAtA[i] = 1 } else { dAtA[i] = 0 } i-- dAtA[i] = 0x28 } n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastUpdated, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdated):]) if err1 != nil { return 0, err1 } i -= n1 i = encodeVarintCheckpoint(dAtA, i, uint64(n1)) i-- dAtA[i] = 0x22 n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.FlushedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.FlushedAt):]) if err2 != nil { return 0, err2 } i -= n2 i = encodeVarintCheckpoint(dAtA, i, uint64(n2)) i-- dAtA[i] = 0x1a n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.To, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.To):]) if err3 != nil { return 0, err3 } i -= n3 i = encodeVarintCheckpoint(dAtA, i, uint64(n3)) i-- dAtA[i] = 0x12 n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.From, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.From):]) if err4 != nil { return 0, err4 } i -= n4 i = encodeVarintCheckpoint(dAtA, i, uint64(n4)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil } func (m *Series) 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 *Series) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } func (m *Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.HighestTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.HighestTs):]) if err5 != nil { return 0, err5 } i -= n5 i = encodeVarintCheckpoint(dAtA, i, uint64(n5)) i-- dAtA[i] = 0x42 if m.EntryCt != 0 { i = encodeVarintCheckpoint(dAtA, i, uint64(m.EntryCt)) i-- dAtA[i] = 0x38 } if len(m.LastLine) > 0 { i -= len(m.LastLine) copy(dAtA[i:], m.LastLine) i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.LastLine))) i-- dAtA[i] = 0x32 } n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.To, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.To):]) if err6 != nil { return 0, err6 } i -= n6 i = encodeVarintCheckpoint(dAtA, i, uint64(n6)) i-- dAtA[i] = 0x2a if len(m.Chunks) > 0 { for iNdEx := len(m.Chunks) - 1; iNdEx >= 0; iNdEx-- { { size, err := m.Chunks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } i -= size i = encodeVarintCheckpoint(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x22 } } if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { size := m.Labels[iNdEx].Size() i -= size if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintCheckpoint(dAtA, i, uint64(size)) } i-- dAtA[i] = 0x1a } } if m.Fingerprint != 0 { i = encodeVarintCheckpoint(dAtA, i, uint64(m.Fingerprint)) i-- dAtA[i] = 0x10 } if len(m.UserID) > 0 { i -= len(m.UserID) copy(dAtA[i:], m.UserID) i = encodeVarintCheckpoint(dAtA, i, uint64(len(m.UserID))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } func encodeVarintCheckpoint(dAtA []byte, offset int, v uint64) int { offset -= sovCheckpoint(v) base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) return base } func (m *Chunk) Size() (n int) { if m == nil { return 0 } var l int _ = l l = github_com_gogo_protobuf_types.SizeOfStdTime(m.From) n += 1 + l + sovCheckpoint(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.To) n += 1 + l + sovCheckpoint(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.FlushedAt) n += 1 + l + sovCheckpoint(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastUpdated) n += 1 + l + sovCheckpoint(uint64(l)) if m.Closed { n += 2 } if m.Synced { n += 2 } l = len(m.Data) if l > 0 { n += 1 + l + sovCheckpoint(uint64(l)) } l = len(m.Head) if l > 0 { n += 1 + l + sovCheckpoint(uint64(l)) } return n } func (m *Series) Size() (n int) { if m == nil { return 0 } var l int _ = l l = len(m.UserID) if l > 0 { n += 1 + l + sovCheckpoint(uint64(l)) } if m.Fingerprint != 0 { n += 1 + sovCheckpoint(uint64(m.Fingerprint)) } if len(m.Labels) > 0 { for _, e := range m.Labels { l = e.Size() n += 1 + l + sovCheckpoint(uint64(l)) } } if len(m.Chunks) > 0 { for _, e := range m.Chunks { l = e.Size() n += 1 + l + sovCheckpoint(uint64(l)) } } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.To) n += 1 + l + sovCheckpoint(uint64(l)) l = len(m.LastLine) if l > 0 { n += 1 + l + sovCheckpoint(uint64(l)) } if m.EntryCt != 0 { n += 1 + sovCheckpoint(uint64(m.EntryCt)) } l = github_com_gogo_protobuf_types.SizeOfStdTime(m.HighestTs) n += 1 + l + sovCheckpoint(uint64(l)) return n } func sovCheckpoint(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } func sozCheckpoint(x uint64) (n int) { return sovCheckpoint(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (this *Chunk) String() string { if this == nil { return "nil" } s := strings.Join([]string{`&Chunk{`, `From:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.From), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `To:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.To), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `FlushedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.FlushedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `LastUpdated:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.LastUpdated), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `Closed:` + fmt.Sprintf("%v", this.Closed) + `,`, `Synced:` + fmt.Sprintf("%v", this.Synced) + `,`, `Data:` + fmt.Sprintf("%v", this.Data) + `,`, `Head:` + fmt.Sprintf("%v", this.Head) + `,`, `}`, }, "") return s } func (this *Series) String() string { if this == nil { return "nil" } repeatedStringForChunks := "[]Chunk{" for _, f := range this.Chunks { repeatedStringForChunks += strings.Replace(strings.Replace(f.String(), "Chunk", "Chunk", 1), `&`, ``, 1) + "," } repeatedStringForChunks += "}" s := strings.Join([]string{`&Series{`, `UserID:` + fmt.Sprintf("%v", this.UserID) + `,`, `Fingerprint:` + fmt.Sprintf("%v", this.Fingerprint) + `,`, `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, `Chunks:` + repeatedStringForChunks + `,`, `To:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.To), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `LastLine:` + fmt.Sprintf("%v", this.LastLine) + `,`, `EntryCt:` + fmt.Sprintf("%v", this.EntryCt) + `,`, `HighestTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.HighestTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `}`, }, "") return s } func valueToStringCheckpoint(v interface{}) string { rv := reflect.ValueOf(v) if rv.IsNil() { return "nil" } pv := reflect.Indirect(rv).Interface() return fmt.Sprintf("*%v", pv) } func (m *Chunk) 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 ErrIntOverflowCheckpoint } 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: Chunk: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Chunk: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.From, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.To, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FlushedAt", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.FlushedAt, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastUpdated", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.LastUpdated, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Closed", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Closed = bool(v != 0) case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Synced", wireType) } var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ v |= int(b&0x7F) << shift if b < 0x80 { break } } m.Synced = bool(v != 0) case 7: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) if m.Data == nil { m.Data = []byte{} } iNdEx = postIndex case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Head", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ byteLen |= int(b&0x7F) << shift if b < 0x80 { break } } if byteLen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + byteLen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } m.Head = append(m.Head[:0], dAtA[iNdEx:postIndex]...) if m.Head == nil { m.Head = []byte{} } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCheckpoint(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthCheckpoint } if (iNdEx + skippy) < 0 { return ErrInvalidLengthCheckpoint } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func (m *Series) 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 ErrIntOverflowCheckpoint } 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: Series: wiretype end group for non-group") } if fieldNum <= 0 { return fmt.Errorf("proto: Series: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UserID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } m.UserID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Fingerprint", wireType) } m.Fingerprint = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.Fingerprint |= uint64(b&0x7F) << shift if b < 0x80 { break } } case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } m.Labels = append(m.Labels, github_com_grafana_loki_v3_pkg_logproto.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Chunks", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } m.Chunks = append(m.Chunks, Chunk{}) if err := m.Chunks[len(m.Chunks)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.To, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 6: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field LastLine", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } intStringLen := int(stringLen) if intStringLen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } m.LastLine = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field EntryCt", wireType) } m.EntryCt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ m.EntryCt |= int64(b&0x7F) << shift if b < 0x80 { break } } case 8: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field HighestTs", wireType) } var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowCheckpoint } if iNdEx >= l { return io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ msglen |= int(b&0x7F) << shift if b < 0x80 { break } } if msglen < 0 { return ErrInvalidLengthCheckpoint } postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthCheckpoint } if postIndex > l { return io.ErrUnexpectedEOF } if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.HighestTs, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipCheckpoint(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { return ErrInvalidLengthCheckpoint } if (iNdEx + skippy) < 0 { return ErrInvalidLengthCheckpoint } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } iNdEx += skippy } } if iNdEx > l { return io.ErrUnexpectedEOF } return nil } func skipCheckpoint(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowCheckpoint } 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, ErrIntOverflowCheckpoint } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } iNdEx++ if dAtA[iNdEx-1] < 0x80 { break } } return iNdEx, nil case 1: iNdEx += 8 return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowCheckpoint } 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, ErrInvalidLengthCheckpoint } iNdEx += length if iNdEx < 0 { return 0, ErrInvalidLengthCheckpoint } return iNdEx, nil case 3: for { var innerWire uint64 var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { return 0, ErrIntOverflowCheckpoint } if iNdEx >= l { return 0, io.ErrUnexpectedEOF } b := dAtA[iNdEx] iNdEx++ innerWire |= (uint64(b) & 0x7F) << shift if b < 0x80 { break } } innerWireType := int(innerWire & 0x7) if innerWireType == 4 { break } next, err := skipCheckpoint(dAtA[start:]) if err != nil { return 0, err } iNdEx = start + next if iNdEx < 0 { return 0, ErrInvalidLengthCheckpoint } } return iNdEx, nil case 4: return iNdEx, nil case 5: iNdEx += 4 return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } } panic("unreachable") } var ( ErrInvalidLengthCheckpoint = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCheckpoint = fmt.Errorf("proto: integer overflow") )