Versions in this module Expand all Collapse all v0 v0.16.0 Oct 4, 2026 v0.15.0 Oct 4, 2026 Changes in this version type Spool + func OpenActive(opts Options) (*Spool, error) + func (s *Spool) ActivateReplacement(next *Spool) error + func (s *Spool) Directory() string + func (s *Spool) StageReplacement() (*Spool, string, error) v0.14.0 Oct 4, 2026 v0.13.0 Oct 4, 2026 Changes in this version type Identity + EnrollmentTokenHash string type Spool + func (s *Spool) SetEnrollment(id Identity) error v0.12.0 Oct 3, 2026 v0.11.0 Oct 2, 2026 v0.10.0 Oct 2, 2026 v0.9.0 Oct 2, 2026 v0.8.0 Oct 1, 2026 v0.7.0 Oct 1, 2026 v0.6.0 Oct 1, 2026 v0.5.0 Oct 1, 2026 v0.4.0 Sep 30, 2026 v0.3.0 Sep 30, 2026 v0.2.0 Sep 30, 2026 Changes in this version + const DefaultCapacityBytes + const DefaultCoalesceAt + const DefaultSegmentBytes + const DefaultWindowBytes + var ErrClosed = errors.New("spool: closed") + var ErrCorrupt = errors.New("spool: corrupt data") + var ErrDivergence = errors.New("spool: divergence") + var ErrEpochMismatch = errors.New("spool: not the current epoch") + var ErrEpochSealed = errors.New("spool: epoch sealed by discard; open a new epoch") + var ErrFull = errors.New("spool: queue full") + var ErrHalted = errors.New("spool: writer halted") + var ErrLocked = errors.New("spool: directory is locked") + var ErrNoEpoch = errors.New("spool: no open epoch") + var ErrNotSpooled = errors.New("spool: record not spooled") + var ErrRebaselineRequired = errors.New("spool: capacity exceeded after full coalescing; rebaseline required") + var ErrRecordsRemain = errors.New("spool: records of the current epoch remain spooled") + var ErrTxDone = errors.New("spool: transaction finished") + func LockDir(dir string) (unlock func() error, err error) + type AppendOption func(*appendOpts) + func WithCursor(key string, value uint64) AppendOption + type ClientStore struct + S *Spool + func (a ClientStore) Commit(epoch protocol.EpochID, seq uint64, chainHash protocol.Hash) error + func (a ClientStore) DiscardAbove(seq uint64) error + func (a ClientStore) Do(fn func(tx client.Tx) error) error + func (a ClientStore) Entries(fromSeq uint64) []*client.Entry + func (a ClientStore) Epoch() (client.EpochState, bool) + func (a ClientStore) Halted() (string, bool) + func (a ClientStore) Identity() client.Identity + func (a ClientStore) Incarnation() uint64 + func (a ClientStore) LastCommitted() (protocol.ChainPoint, bool) + func (a ClientStore) MarkRegistered() error + func (a ClientStore) MarkTransmitted(seqs ...uint64) error + func (a ClientStore) Notify() <-chan struct{} + func (a ClientStore) OpenEpoch(reason string, prev *protocol.EpochID, prevHead *uint64) (protocol.EpochID, error) + func (a ClientStore) SetHalted(code string) error + func (a ClientStore) SetIdentity(id client.Identity) error + func (a ClientStore) WriterID() protocol.WriterID + type ClientTx struct + T *Tx + func (a ClientTx) Append(t protocol.RecordType, ...) (*client.Entry, error) + func (a ClientTx) AppendWithCursor(t protocol.RecordType, ...) (*client.Entry, error) + type Entry struct + Bytes []byte + ChainHash protocol.Hash + Hash protocol.Hash + Seq uint64 + State RecordState + Type protocol.RecordType + type EpochState struct + Chain protocol.Chain + ID protocol.EpochID + OpenReason string + OpenedAt time.Time + PrevEpoch *protocol.EpochID + PrevHead *uint64 + Registered bool + Sealed bool + SealedAt uint64 + TargetID string + type Halt struct + At time.Time + Code string + Message string + type Identity struct + Credential string + CredentialID string + MachineID string + TargetID string + TargetType string + type Options struct + CapacityBytes int64 + Clock func() time.Time + CoalesceAt float64 + CommitFault func() error + Dir string + SegmentBytes int64 + WindowBytes int64 + type Queue struct + func OpenQueue(dir string, capacityBytes int64) (*Queue, error) + func (q *Queue) Ack(seq uint64) error + func (q *Queue) Append(b []byte) (uint64, error) + func (q *Queue) Close() error + func (q *Queue) Err() error + func (q *Queue) ID() string + func (q *Queue) Peek(fromSeq uint64, maxBytes int) []QueueItem + func (q *Queue) Usage() QueueUsage + type QueueItem struct + Data []byte + Seq uint64 + type QueueUsage struct + Acked uint64 + Bytes int64 + Capacity int64 + Items uint64 + Next uint64 + type RecordState uint8 + const NeverTransmitted + const TransmittedUnconfirmed + func (s RecordState) String() string + type Relief struct + BytesAfter int64 + BytesBefore int64 + EvidenceEvicted int + Exhausted bool + RecordsCoalesced int + SamplesCompacted int + SegmentsCompacted int + Unavailable []protocol.Span + type Spool struct + func Open(opts Options) (*Spool, error) + func (s *Spool) ClearHalt() error + func (s *Spool) Close() error + func (s *Spool) Commit(epoch protocol.EpochID, seq uint64, chainHash protocol.Hash) error + func (s *Spool) Cursor(key string) uint64 + func (s *Spool) Cursors(prefix string) map[string]uint64 + func (s *Spool) DiscardAbove(seq uint64) error + func (s *Spool) Do(fn func(tx *Tx) error) error + func (s *Spool) Entries(fromSeq uint64) []*Entry + func (s *Spool) Epoch() (EpochState, bool) + func (s *Spool) Err() error + func (s *Spool) Halted() (Halt, bool) + func (s *Spool) Identity() Identity + func (s *Spool) Incarnation() uint64 + func (s *Spool) KV(bucket string) kv.Store + func (s *Spool) LastCommitted() (protocol.ChainPoint, bool) + func (s *Spool) LoadRecoverySnapshot() ([]byte, bool, error) + func (s *Spool) MarkRegistered() error + func (s *Spool) MarkTransmitted(seqs ...uint64) error + func (s *Spool) Notify() <-chan struct{} + func (s *Spool) OpenEpoch(reason string, prev *protocol.EpochID, prevHead *uint64) (protocol.EpochID, error) + func (s *Spool) Relieve() (Relief, error) + func (s *Spool) SaveRecoverySnapshot(b []byte) error + func (s *Spool) SetHalted(code, message string) error + func (s *Spool) SetIdentity(id Identity) error + func (s *Spool) Usage() Usage + func (s *Spool) WriterID() protocol.WriterID + type Tx struct + func (tx *Tx) Append(t protocol.RecordType, ...) (*Entry, error) + func (tx *Tx) DeleteCursor(key string) + func (tx *Tx) OnAbort(f func()) + func (tx *Tx) OnCommit(f func()) + type Usage struct + AppendRate float64 + Bytes int64 + Capacity int64 + DiskBytes int64 + InFlightBytes int64 + Oldest time.Time + ProjectedWindow time.Duration + RebaselineRequired bool + Records int + ReliefError error + WindowBytes int64