Versions in this module Expand all Collapse all v2 v2.0.0 Jun 14, 2023 Changes in this version + const DefaultChunkFormat + const GzipLogChunk + const LogChunk + var BytesBufferPool = pool.New(1 << 9, 1 << 13, 2, func(size int) interface{} { ... }) + var EncodeBufferPool = sync.Pool + var ErrChunkFull = errors.New("chunk full") + var ErrInvalidChecksum = errors.New("invalid chunk checksum") + var ErrInvalidFlag = errors.New("invalid flag") + var ErrInvalidSize = errors.New("invalid size") + var ErrOutOfOrder = errors.New("entry out of order") + var Flate = FlatePool + var Gzip = GzipPool + var HeadBlockFmts = []HeadBlockFmt + var Lz4_1M = LZ4Pool + var Lz4_256k = LZ4Pool + var Lz4_4M = LZ4Pool + var Lz4_64k = LZ4Pool + var Noop NoopPool + var SamplesPool = pool.New(1 << 9, 1 << 14, 2, func(size int) interface{} { ... }) + var Snappy SnappyPool + var Zstd = ZstdPool + func ErrTooFarBehind(cutoff time.Time) error + func IsErrTooFarBehind(err error) bool + func IsOutOfOrderErr(err error) bool + func NewFacade(c Chunk, blockSize, targetSize int) chunk.Data + func SupportedEncoding() string + func UncompressedSize(c chunk.Data) (int, bool) + type Block interface + Entries func() int + Iterator func(ctx context.Context, pipeline log.StreamPipeline) iter.EntryIterator + MaxTime func() int64 + MinTime func() int64 + Offset func() int + SampleIterator func(ctx context.Context, extractor log.StreamSampleExtractor) iter.SampleIterator + type Chunk interface + Append func(*logproto.Entry) error + BlockCount func() int + Blocks func(mintT, maxtT time.Time) []Block + Bounds func() (time.Time, time.Time) + Bytes func() ([]byte, error) + BytesWith func([]byte) ([]byte, error) + Close func() error + CompressedSize func() int + Encoding func() Encoding + Iterator func(ctx context.Context, mintT, maxtT time.Time, direction logproto.Direction, ...) (iter.EntryIterator, error) + Rebound func(start, end time.Time, filter filter.Func) (Chunk, error) + SampleIterator func(ctx context.Context, from, through time.Time, ...) iter.SampleIterator + Size func() int + SpaceFor func(*logproto.Entry) bool + UncompressedSize func() int + Utilization func() float64 + func NewDumbChunk() Chunk + type Encoding byte + const EncDumb + const EncFlate + const EncGZIP + const EncLZ4_1M + const EncLZ4_256k + const EncLZ4_4M + const EncLZ4_64k + const EncNone + const EncSnappy + const EncZstd + func ParseEncoding(enc string) (Encoding, error) + func (e Encoding) String() string + type Facade struct + func (Facade) Encoding() chunk.Encoding + func (f *Facade) UnmarshalFromBuf(buf []byte) error + func (f Facade) Bounds() (time.Time, time.Time) + func (f Facade) Entries() int + func (f Facade) LokiChunk() Chunk + func (f Facade) Marshal(w io.Writer) error + func (f Facade) Rebound(start, end model.Time, filter filter.Func) (chunk.Data, error) + func (f Facade) Size() int + func (f Facade) UncompressedSize() int + func (f Facade) Utilization() float64 + type FlatePool struct + func (pool *FlatePool) GetReader(src io.Reader) (io.Reader, error) + func (pool *FlatePool) GetWriter(dst io.Writer) io.WriteCloser + func (pool *FlatePool) PutReader(reader io.Reader) + func (pool *FlatePool) PutWriter(writer io.WriteCloser) + type GzipPool struct + func (pool *GzipPool) GetReader(src io.Reader) (io.Reader, error) + func (pool *GzipPool) GetWriter(dst io.Writer) io.WriteCloser + func (pool *GzipPool) PutReader(reader io.Reader) + func (pool *GzipPool) PutWriter(writer io.WriteCloser) + type HeadBlock interface + Append func(int64, string) error + Bounds func() (mint, maxt int64) + CheckpointBytes func(b []byte) ([]byte, error) + CheckpointSize func() int + CheckpointTo func(w io.Writer) error + Convert func(HeadBlockFmt) (HeadBlock, error) + Entries func() int + Format func() HeadBlockFmt + IsEmpty func() bool + Iterator func(ctx context.Context, direction logproto.Direction, mint, maxt int64, ...) iter.EntryIterator + LoadBytes func(b []byte) error + Reset func() + SampleIterator func(ctx context.Context, mint, maxt int64, extractor log.StreamSampleExtractor) iter.SampleIterator + Serialise func(pool WriterPool) ([]byte, error) + UncompressedSize func() int + func HeadFromCheckpoint(b []byte, desired HeadBlockFmt) (HeadBlock, error) + type HeadBlockFmt byte + const OrderedHeadBlockFmt + const UnorderedHeadBlockFmt + func (f HeadBlockFmt) Byte() byte + func (f HeadBlockFmt) NewBlock() HeadBlock + func (f HeadBlockFmt) String() string + type LZ4Pool struct + func (pool *LZ4Pool) GetReader(src io.Reader) (io.Reader, error) + func (pool *LZ4Pool) GetWriter(dst io.Writer) io.WriteCloser + func (pool *LZ4Pool) PutReader(reader io.Reader) + func (pool *LZ4Pool) PutWriter(writer io.WriteCloser) + type MemChunk struct + func MemchunkFromCheckpoint(chk, head []byte, desired HeadBlockFmt, blockSize int, targetSize int) (*MemChunk, error) + func NewByteChunk(b []byte, blockSize, targetSize int) (*MemChunk, error) + func NewMemChunk(enc Encoding, head HeadBlockFmt, blockSize, targetSize int) *MemChunk + func (c *MemChunk) Append(entry *logproto.Entry) error + func (c *MemChunk) BlockCount() int + func (c *MemChunk) Blocks(mintT, maxtT time.Time) []Block + func (c *MemChunk) Bounds() (fromT, toT time.Time) + func (c *MemChunk) Bytes() ([]byte, error) + func (c *MemChunk) BytesSize() int + func (c *MemChunk) BytesWith(b []byte) ([]byte, error) + func (c *MemChunk) CheckpointSize() (chunk, head int) + func (c *MemChunk) Close() error + func (c *MemChunk) CompressedSize() int + func (c *MemChunk) ConvertHead(desired HeadBlockFmt) error + func (c *MemChunk) Encoding() Encoding + func (c *MemChunk) Iterator(ctx context.Context, mintT, maxtT time.Time, direction logproto.Direction, ...) (iter.EntryIterator, error) + func (c *MemChunk) Rebound(start, end time.Time, filter filter.Func) (Chunk, error) + func (c *MemChunk) SampleIterator(ctx context.Context, from, through time.Time, ...) iter.SampleIterator + func (c *MemChunk) SerializeForCheckpointTo(chk, head io.Writer) error + func (c *MemChunk) Size() int + func (c *MemChunk) SpaceFor(e *logproto.Entry) bool + func (c *MemChunk) UncompressedSize() int + func (c *MemChunk) Utilization() float64 + func (c *MemChunk) WriteTo(w io.Writer) (int64, error) + type NoopPool struct + func (pool *NoopPool) GetReader(src io.Reader) (io.Reader, error) + func (pool *NoopPool) GetWriter(dst io.Writer) io.WriteCloser + func (pool *NoopPool) PutReader(_ io.Reader) + func (pool *NoopPool) PutWriter(_ io.WriteCloser) + type ReaderPool interface + GetReader func(io.Reader) (io.Reader, error) + PutReader func(io.Reader) + type SnappyPool struct + func (pool *SnappyPool) GetReader(src io.Reader) (io.Reader, error) + func (pool *SnappyPool) GetWriter(dst io.Writer) io.WriteCloser + func (pool *SnappyPool) PutReader(reader io.Reader) + func (pool *SnappyPool) PutWriter(writer io.WriteCloser) + type WriterPool interface + GetWriter func(io.Writer) io.WriteCloser + PutWriter func(io.WriteCloser) + type ZstdPool struct + func (pool *ZstdPool) GetReader(src io.Reader) (io.Reader, error) + func (pool *ZstdPool) GetWriter(dst io.Writer) io.WriteCloser + func (pool *ZstdPool) PutReader(reader io.Reader) + func (pool *ZstdPool) PutWriter(writer io.WriteCloser)