Versions in this module Expand all Collapse all v3 v3.0.0 Apr 8, 2024 Changes in this version + const ChunkPageSize + const DefaultMaxChunksToBypassMarkerLookup + const FormatV1 + const FormatV2 + const FormatV3 + const HeaderLen + const IndexFilename + const MagicIndex + const ShardLabel + const ShardLabelFmt + func AllPostingsKey() (name, value string) + func ExpandPostings(p Postings) (res []storage.SeriesRef, err error) + func ReadOffsetTable(bs ByteSlice, off uint64, f func([]string, uint64, int) error) error + type ByteSlice interface + Len func() int + Range func(start, end int) []byte + type ChunkMeta struct + Checksum uint32 + Entries uint32 + KB uint32 + MaxTime int64 + MinTime int64 + func (c ChunkMeta) Bounds() (model.Time, model.Time) + func (c ChunkMeta) From() model.Time + func (c ChunkMeta) Through() model.Time + type ChunkMetas []ChunkMeta + func (c ChunkMetas) Add(chk ChunkMeta) ChunkMetas + func (c ChunkMetas) Bounds() (mint, maxt model.Time) + func (c ChunkMetas) Drop(chk ChunkMeta) (ChunkMetas, bool) + func (c ChunkMetas) Finalize() ChunkMetas + func (c ChunkMetas) Len() int + func (c ChunkMetas) Less(i, j int) bool + func (c ChunkMetas) Swap(i, j int) + type ChunkStats struct + Chunks uint64 + Entries uint64 + KB uint64 + func (cs *ChunkStats) AddChunk(chk *ChunkMeta, from, through int64) + type Decoder struct + LookupSymbol func(uint32) (string, error) + func (dec *Decoder) ChunkStats(version int, b []byte, seriesRef storage.SeriesRef, from, through int64, ...) (uint64, ChunkStats, error) + func (dec *Decoder) LabelNamesOffsetsFor(b []byte) ([]uint32, error) + func (dec *Decoder) LabelValueFor(b []byte, label string) (string, error) + func (dec *Decoder) Postings(b []byte) (int, Postings, error) + func (dec *Decoder) Series(version int, b []byte, seriesRef storage.SeriesRef, from int64, through int64, ...) (uint64, error) + type FileWriter struct + func NewFileWriter(name string) (*FileWriter, error) + func (fw *FileWriter) AddPadding(size int) error + func (fw *FileWriter) Close() error + func (fw *FileWriter) Flush() error + func (fw *FileWriter) Pos() uint64 + func (fw *FileWriter) Remove() error + func (fw *FileWriter) Write(bufs ...[]byte) error + func (fw *FileWriter) WriteAt(buf []byte, pos uint64) error + type FingerprintFilter interface + GetFromThrough func() (model.Fingerprint, model.Fingerprint) + Match func(model.Fingerprint) bool + type FingerprintOffsets [][2]uint64 + func (xs FingerprintOffsets) Range(fpFilter FingerprintFilter) (minOffset, maxOffset uint64) + type ListPostings struct + func (it *ListPostings) At() storage.SeriesRef + func (it *ListPostings) Err() error + func (it *ListPostings) Next() bool + func (it *ListPostings) Seek(x storage.SeriesRef) bool + type MemPostings struct + func NewMemPostings() *MemPostings + func NewUnorderedMemPostings() *MemPostings + func (p *MemPostings) Add(id storage.SeriesRef, lset labels.Labels) + func (p *MemPostings) All() Postings + func (p *MemPostings) Delete(deleted map[storage.SeriesRef]struct{}) + func (p *MemPostings) EnsureOrder() + func (p *MemPostings) Get(name, value string) Postings + func (p *MemPostings) Iter(f func(labels.Label, Postings) error) error + func (p *MemPostings) LabelNames() []string + func (p *MemPostings) LabelValues(name string) []string + func (p *MemPostings) SortedKeys() []labels.Label + func (p *MemPostings) Stats(label string) *PostingsStats + func (p *MemPostings) Symbols() StringIter + type Metadata struct + Checksum uint32 + From int64 + Through int64 + func (m *Metadata) EnsureBounds(from, through int64) + type PoolChunkMetas struct + var ChunkMetasPool PoolChunkMetas + func (p *PoolChunkMetas) Get() []ChunkMeta + func (p *PoolChunkMetas) Put(xs []ChunkMeta) + type Postings interface + At func() storage.SeriesRef + Err func() error + Next func() bool + Seek func(v storage.SeriesRef) bool + func EmptyPostings() Postings + func ErrPostings(err error) Postings + func Intersect(its ...Postings) Postings + func Merge(its ...Postings) Postings + func NewListPostings(list []storage.SeriesRef) Postings + func Without(full, drop Postings) Postings + type PostingsStats struct + CardinalityLabelStats []Stat + CardinalityMetricsStats []Stat + LabelValuePairsStats []Stat + LabelValueStats []Stat + NumLabelPairs int + type Range struct + End int64 + Start int64 + type Reader struct + func NewFileReader(path string) (*Reader, error) + func NewReader(b ByteSlice) (*Reader, error) + func (r *Reader) Bounds() (int64, int64) + func (r *Reader) Checksum() uint32 + func (r *Reader) ChunkStats(id storage.SeriesRef, from, through int64, lbls *labels.Labels) (uint64, ChunkStats, error) + func (r *Reader) Close() error + func (r *Reader) LabelNames(matchers ...*labels.Matcher) ([]string, error) + func (r *Reader) LabelNamesFor(ids ...storage.SeriesRef) ([]string, error) + func (r *Reader) LabelValueFor(id storage.SeriesRef, label string) (string, error) + func (r *Reader) LabelValues(name string, matchers ...*labels.Matcher) ([]string, error) + func (r *Reader) Postings(name string, fpFilter FingerprintFilter, values ...string) (Postings, error) + func (r *Reader) PostingsRanges() (map[labels.Label]Range, error) + func (r *Reader) RawFileReader() (io.ReadSeeker, error) + func (r *Reader) Series(id storage.SeriesRef, from int64, through int64, lbls *labels.Labels, ...) (uint64, error) + func (r *Reader) Size() int64 + func (r *Reader) SortedLabelValues(name string, matchers ...*labels.Matcher) ([]string, error) + func (r *Reader) SymbolTableSize() uint64 + func (r *Reader) Symbols() StringIter + func (r *Reader) Version() int + type RealByteSlice []byte + func (b RealByteSlice) Len() int + func (b RealByteSlice) Range(start, end int) []byte + func (b RealByteSlice) Sub(start, end int) ByteSlice + type ShardAnnotation struct + Of uint32 + Shard uint32 + func NewShard(x, of uint32) ShardAnnotation + func (shard ShardAnnotation) GetFromThrough() (model.Fingerprint, model.Fingerprint) + func (shard ShardAnnotation) Match(fp model.Fingerprint) bool + func (shard ShardAnnotation) RequiredBits() uint64 + func (shard ShardAnnotation) String() string + func (shard ShardAnnotation) Validate() error + type ShardedPostings struct + func NewShardedPostings(p Postings, fpFilter FingerprintFilter, offsets FingerprintOffsets) *ShardedPostings + func (sp *ShardedPostings) At() storage.SeriesRef + func (sp *ShardedPostings) Err() (err error) + func (sp *ShardedPostings) Next() bool + func (sp *ShardedPostings) Seek(v storage.SeriesRef) (res bool) + type Stat struct + Count uint64 + Name string + type StringIter interface + At func() string + Err func() error + Next func() bool + func NewStringListIter(s []string) StringIter + type Symbols struct + func NewSymbols(bs ByteSlice, version, off int) (*Symbols, error) + func (s Symbols) Iter() StringIter + func (s Symbols) Lookup(o uint32) (string, error) + func (s Symbols) ReverseLookup(sym string) (uint32, error) + func (s Symbols) Size() int + type TOC struct + FingerprintOffsets uint64 + LabelIndices uint64 + LabelIndicesTable uint64 + Metadata Metadata + Postings uint64 + PostingsTable uint64 + Series uint64 + Symbols uint64 + func NewTOCFromByteSlice(bs ByteSlice) (*TOC, error) + type Writer struct + Version int + func NewWriter(ctx context.Context, indexFormat int, fn string) (*Writer, error) + func NewWriterWithVersion(ctx context.Context, version int, fn string) (*Writer, error) + func (w *Writer) AddSeries(ref storage.SeriesRef, lset labels.Labels, fp model.Fingerprint, ...) error + func (w *Writer) AddSymbol(sym string) error + func (w *Writer) Close() error