Versions in this module Expand all Collapse all v1 v1.0.1 Aug 28, 2026 v1.0.0 Aug 28, 2026 Changes in this version + const BloomMinBytes + const BloomResizeFill + const BloomTargetBitsPerKey + const DefaultSerializationThreshold + const FlushKey + var ErrAuthorityDropped = errors.New("authority dropped: not subscribed to this key") + var ErrBootstrapIncomplete = errors.New("bootstrap incomplete: some peers unreachable") + var ErrCDNBlobMissing = errors.New("cdn blob missing") + var ErrCloudUnavailable = errors.New("cloud unavailable") + var ErrCuckooFull = errors.New("cuckoo filter is full") + var ErrRegionPartitioned = errors.New("region partitioned: not all same-region peers are reachable") + var ErrTxnAborted = errors.New("transaction aborted") + func BloomHash(name []byte) uint64 + func BuildOffsetNotify(nodeID pb.NodeID, offset Tip, eff *pb.Effect, data []byte, ...) *pb.OffsetNotify + func Compress(b []byte) []byte + func CompressEffectValues(eff *pb.Effect) + func ComputeForkChoiceHash(nodeID proto.NodeID, hlc *timestamppb.Timestamp) []byte + func Decompress(b []byte) ([]byte, error) + func ForkChoiceLess(a, b []byte) bool + func ForwardingEnabled() bool + func InflatedSizeDelta(eff *pb.Effect) uint64 + func MarshalEffect(eff *pb.Effect) ([]byte, error) + func ReduceBranch(effects []*pb.Effect) *pb.ReducedEffect + func ReduceChain(seed *pb.ReducedEffect, effects []*pb.Effect) *pb.ReducedEffect + func UnmarshalEffect(data []byte, eff *pb.Effect) error + type Bloom struct + func NewBloom(sizeBytes int) *Bloom + func NewBloomForCount(count int) *Bloom + func ParseBloomFrame(data []byte) (*Bloom, error) + func (b *Bloom) Fill() float64 + func (b *Bloom) Frame() []byte + func (b *Bloom) Has(name []byte) bool + func (b *Bloom) HasHash(h uint64) bool + func (b *Bloom) Set(name []byte) bool + func (b *Bloom) SetHash(h uint64) bool + func (b *Bloom) SizeBytes() int + type Broadcaster interface + AllRegionPeersReachable func() bool + Broadcast func(notify *pb.OffsetNotify) + BroadcastWithData func(notify *pb.OffsetNotify, effectData []byte) + Fetch func(ref *pb.EffectRef) ([]byte, error) + FetchFromAny func(ref *pb.EffectRef, hint FetchHint) ([]byte, error) + ForwardTransaction func(ctx context.Context, targetNodeID pb.NodeID, tx *pb.ForwardedTransaction) (*pb.ForwardedResponse, error) + InMajorityPartition func() bool + PeerIDs func() []pb.NodeID + Replicate func(notify *pb.OffsetNotify, wireData []byte) error + ReplicateMarshalled func(notify *pb.OffsetNotify, notifyBody []byte, targetNodeID pb.NodeID) ([]*pb.NackNotify, error) + ReplicateTo func(notify *pb.OffsetNotify, wireData []byte, targetNodeID pb.NodeID) ([]*pb.NackNotify, error) + SendNack func(nack *pb.NackNotify, targetNodeID pb.NodeID) + type BunnyStorage struct + func NewBunnyStorage(uploadEndpoint, cdnEndpoint, accessKey string) *BunnyStorage + func (b *BunnyStorage) Download(ctx context.Context, path string) ([]byte, error) + func (b *BunnyStorage) Upload(ctx context.Context, path string, data []byte) error + type CloudEffect struct + Eff *pb.Effect + ProtoLen int + Tip Tip + type CloudReader interface + CloudTips func(ctx context.Context, key string) (tips []Tip, sidecar []CloudEffect, missing []Tip, err error) + MarkPending func(key string) + MayHold func(key string) bool + type Context struct + func (c *Context) Abort() + func (c *Context) BeginTx() + func (c *Context) CheckWatches() bool + func (c *Context) ClearWatches() + func (c *Context) Emit(eff *pb.Effect, snapshotTips ...[]Tip) error + func (c *Context) Flush() error + func (c *Context) GetSnapshot(key string) (*pb.ReducedEffect, []Tip, error) + func (c *Context) PendingKeys() []string + func (c *Context) RestoreSavepoint(sp *ContextSavepoint) + func (c *Context) SetTraceCtx(ctx context.Context) + func (c *Context) TakeSavepoint() *ContextSavepoint + func (c *Context) TraceCtx() context.Context + func (c *Context) Watch(key string) error + type ContextSavepoint struct + type CuckooChain struct + func (cc *CuckooChain) Add(key string) bool + func (cc *CuckooChain) MarshalBinary() ([]byte, error) + func (cc *CuckooChain) MaybeContains(key string) bool + func (cc *CuckooChain) UnmarshalBinary(data []byte) error + type CuckooFilter struct + func NewCuckooFilter(capacity int) *CuckooFilter + func (c *CuckooFilter) Add(key string) error + func (c *CuckooFilter) Count() uint64 + func (c *CuckooFilter) LoadFactor() float64 + func (c *CuckooFilter) MarshalBinary() ([]byte, error) + func (c *CuckooFilter) MaybeContains(key string) bool + func (c *CuckooFilter) UnmarshalBinary(data []byte) error + type Encryptor struct + func NewEncryptorFromIKM(ikm []byte) (*Encryptor, error) + func (enc *Encryptor) OpenAndDecompress(sealed, info []byte) ([]byte, error) + func (enc *Encryptor) SealAndCompress(plaintext, info []byte) ([]byte, error) + type Engine struct + OnEphemeralSubscribe func(subscriberNodeID uint64, routingKey []byte, unsubscribe bool) + OnFlushAll func() + OnKeyDataAdded func(key string) + OnKeyDeleted func(key string) + OnLocalEffect func(offset Tip, eff *pb.Effect) + OnPubSubMessage func(channel, payload []byte) + func NewEngine(cfg EngineConfig) *Engine + func NewTestEngine() *Engine + func (e *Engine) ArenaBytes() int64 + func (e *Engine) AverageK() float64 + func (e *Engine) CachePeerFilter(peer pb.NodeID, data []byte, version uint64) + func (e *Engine) CheckSerializationLeader(key string) *pb.NodeID + func (e *Engine) Close() error + func (e *Engine) DropPeer(peer pb.NodeID) + func (e *Engine) EffectCache() *VertexPool + func (e *Engine) EvictStats() keytrie.EvictStats + func (e *Engine) FlushIndex() + func (e *Engine) Forward(commandName string, args [][]byte, keys []string, username string) []byte + func (e *Engine) ForwardExec(commands []ForwardCommand, watchedKeys []string, username string) []byte + func (e *Engine) GetLock(key string) *sync.Mutex + func (e *Engine) GetSnapshot(key string) (*pb.ReducedEffect, []Tip, int, error) + func (e *Engine) HandleNack(nack *pb.NackNotify) error + func (e *Engine) HandleRemote(notify *pb.OffsetNotify) ([]*pb.NackNotify, error) + func (e *Engine) InstallCloudTips(key string, tips []Tip, sidecar []CloudEffect, missing []Tip) (pending []Tip, err error) + func (e *Engine) KeyCount() int64 + func (e *Engine) MatchKeys(pattern string) []string + func (e *Engine) MemoryTarget() int64 + func (e *Engine) NewContext() *Context + func (e *Engine) NewReadOnlyContext() *Context + func (e *Engine) NodeID() pb.NodeID + func (e *Engine) NotePeerConnected(peer pb.NodeID) + func (e *Engine) OwnKeyFilterSnapshot() ([]byte, uint64) + func (e *Engine) PeerSubscribers(key string) []pb.NodeID + func (e *Engine) PinKey(key string) bool + func (e *Engine) ReconvergeAllKeys() + func (e *Engine) RecordSerializationActivity(key string) + func (e *Engine) ReleaseQueueDepth() int + func (e *Engine) ScanKeys(after string, pattern string, fn func(key string) bool) + func (e *Engine) SetBroadcaster(b Broadcaster) + func (e *Engine) SetCloudReader(r CloudReader) + func (e *Engine) SetOnLocalEffect(hook func(offset Tip, eff *pb.Effect)) + func (e *Engine) SetRTTProvider(p PeerRTTProvider) + func (e *Engine) StartAntiEntropy(interval time.Duration) + func (e *Engine) UnpinKey(key string) bool + func (e *Engine) UpdateSafetyRules(defaultMode SafetyMode, rules []KeyRangeRule) + func (e *Engine) VertexCount() int + type EngineConfig struct + Broadcaster Broadcaster + CompressValues bool + DefaultMode SafetyMode + KeyRangeRules []KeyRangeRule + MemoryLimit int64 + MemoryLimitPercent float64 + NodeID pb.NodeID + RTTProvider PeerRTTProvider + func (c *EngineConfig) ModeForKey(key string) SafetyMode + type FetchHint uint8 + const PreferCDN + const PreferPeers + type ForwardCommand struct + Args [][]byte + Keys []string + Name string + type HorizonSet struct + func (h *HorizonSet) Abort(txnID string) + func (h *HorizonSet) Add(txnID string, bindOffset Tip, bind *pb.TransactionalBindEffect) + func (h *HorizonSet) Empty() bool + func (h *HorizonSet) IsInvisible(txnID string) bool + func (h *HorizonSet) MakeVisible(txnID string) + func (h *HorizonSet) ScheduleMakeVisible(txnID string, wait time.Duration) + func (h *HorizonSet) WaitForClear(txnID string) *HorizonWait + type HorizonWait struct + func (w *HorizonWait) Release() + type KeyRangeRule struct + Mode SafetyMode + Pattern string + type MemoryStorage struct + func NewMemoryStorage() *MemoryStorage + func (m *MemoryStorage) Download(_ context.Context, path string) ([]byte, error) + func (m *MemoryStorage) Keys() []string + func (m *MemoryStorage) Upload(_ context.Context, path string, data []byte) error + type ObjectStorage interface + Download func(ctx context.Context, path string) ([]byte, error) + Upload func(ctx context.Context, path string, data []byte) error + type PeerRTTProvider interface + AlivePeerIDs func() []pb.NodeID + GetRTT func(nodeID pb.NodeID) time.Duration + type SafetyMode int + const SafeMode + const UnsafeMode + type Tip = keytrie.EffectRef + func NormalizeCloudTipCandidates(key string, candidates, localRoots []Tip, load func(Tip) (*pb.Effect, error)) (real, superseded []Tip, err error) + type VertexPool struct + func (p *VertexPool) Bytes() int64 + func (p *VertexPool) ColdEvictions() uint64 + func (p *VertexPool) Decref(tip Tip) + func (p *VertexPool) EntryCount() int + func (p *VertexPool) Get(tip Tip) (*pb.Effect, bool) + func (p *VertexPool) Incref(tip Tip) bool + func (p *VertexPool) Put(tip Tip, eff *pb.Effect) + func (p *VertexPool) PutSized(tip Tip, eff *pb.Effect, protoLen int) + func (p *VertexPool) PutSizedCache(tip Tip, eff *pb.Effect, protoLen int) + func (p *VertexPool) Reclaimed() uint64 + func (p *VertexPool) Stats() (hits, misses, reclaimed uint64)