aggregate

package
v0.16.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package aggregate provides private, bounded resident storage for capture state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Health

type Health struct {
	LimitBytes    int64  `json:"limitBytes"`
	ResidentBytes int64  `json:"residentBytes"`
	PeakBytes     int64  `json:"peakBytes"`
	DiskReads     uint64 `json:"diskReads"`
	DiskWrites    uint64 `json:"diskWrites"`
	Evictions     uint64 `json:"evictions"`
	DatabaseBytes int64  `json:"databaseBytes"`
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store owns an ephemeral SQLite file. ResidentBytes charges encoded values, keys and 256 bytes per LRU entry; SQLite has a separate 1 MiB page cache. A caller's decoded record and serialization scratch are outside this cache.

func Open

func Open(directory string, limit int64, cancel func()) (*Store, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Do

func (s *Store) Do(fn func(*Tx) error) error

func (*Store) Error

func (s *Store) Error() error

func (*Store) Health

func (s *Store) Health() Health

type Tx

type Tx struct {
	// contains filtered or unexported fields
}

Tx is valid only inside Do's callback. Callbacks must not call Store methods.

func (*Tx) Count

func (t *Tx) Count(prefix string) (int64, error)

func (*Tx) Delete

func (t *Tx) Delete(prefix string) error

func (*Tx) DeleteKey

func (t *Tx) DeleteKey(key string) error

func (*Tx) Each

func (t *Tx) Each(prefix string, fn func(string, []byte) error) error

Each visits an ordered range with one row resident at a time. The callback may replace the same key; it must not add keys to the range being visited.

func (*Tx) Find

func (t *Tx) Find(prefix, upper string, descending bool) (string, []byte, bool, error)

Find selects the nearest key in prefix's range, optionally bounded above. It merges dirty cache entries with persisted rows without flushing the cache.

func (*Tx) Get

func (t *Tx) Get(key string) ([]byte, bool, error)

func (*Tx) Last

func (t *Tx) Last(prefix string) (string, []byte, bool, error)

func (*Tx) Next

func (t *Tx) Next(prefix, after string) (string, []byte, bool, error)

Next returns one ordered row after flushing pending writes. An empty after starts at prefix. Callers can release Do's lock between successive records.

func (*Tx) Put

func (t *Tx) Put(key string, value []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL