Versions in this module Expand all Collapse all v0 v0.1.0 Jul 7, 2026 Changes in this version + func SuggestLevels(hotKeys, cellsPerLevel uint32, targetP float64) uint32 + type Aggregator func(levelScores []float64) float64 + var Max Aggregator = func(levelScores []float64) float64 { ... } + var Mean Aggregator = func(levelScores []float64) float64 { ... } + var Min Aggregator = func(levelScores []float64) float64 { ... } + type Clock interface + Now func() time.Time + type Config struct + Aggregator Aggregator + CellsPerLevel uint32 + Clock Clock + Decay Decay + Hasher HasherFactory + Hi float64 + Levels uint32 + Lo float64 + type Decay interface + Apply func(score float64, dtMillis int64) float64 + var None Decay = noneDecay{} + func Exponential(lambdaPerSec float64) Decay + func Linear(ratePerSec float64) Decay + type Hasher interface + Hash64 func(key []byte) uint64 + type HasherFactory func(seed uint64) Hasher + func Murmur3() HasherFactory + func SipHash() HasherFactory + type Result struct + Aggregate float64 + CellIndexes []uint32 + LevelScores []float64 + type Rotator struct + func NewRotator(cfg RotatorConfig) (*Rotator, error) + func (r *Rotator) Close() + func (r *Rotator) Query(key []byte) float64 + func (r *Rotator) QueryDetailed(key []byte) Result + func (r *Rotator) Rotations() int64 + func (r *Rotator) TryUpdate(key []byte, delta, limit float64) bool + func (r *Rotator) Update(key []byte, delta float64) + func (r *Rotator) UpdateAndQuery(key []byte, delta float64) float64 + type RotatorConfig struct + Generations uint32 + Period time.Duration + Sketch Config + Ticker Ticker + type Sketch struct + func New(cfg Config) (*Sketch, error) + func NewWithSeed(cfg Config, seed uint64) (*Sketch, error) + func (s *Sketch) Config() Config + func (s *Sketch) Query(key []byte) float64 + func (s *Sketch) QueryDetailed(key []byte) Result + func (s *Sketch) Seed() uint64 + func (s *Sketch) TryUpdate(key []byte, delta, limit float64) bool + func (s *Sketch) Update(key []byte, delta float64) + func (s *Sketch) UpdateAndQuery(key []byte, delta float64) float64 + type Ticker interface + C func() <-chan time.Time + Stop func()