Versions in this module Expand all Collapse all v0 v0.1.0 Jul 16, 2026 Changes in this version + const DefaultDocumentID + const DocumentSnapshotFilename + const InitialGeneration + var ErrDocumentMismatch = errors.New("qi: document mismatch") + var ErrDurabilityUncertain = errors.New("qi: checkpoint durability uncertain") + var ErrEmptyReplicaID = errors.New("qi: replica id is empty") + var ErrGenerationMismatch = errors.New("qi: generation mismatch") + var ErrInvalidVisibleJSON = errors.New("qi: invalid visible JSON") + var ErrMalformedSyncArtifact = errors.New("qi: malformed sync artifact") + func SnapshotPath(dataDir string) string + type CatchUp struct + Delta *DeltaArtifact + Snapshot *SnapshotArtifact + type CheckpointCommitter interface + CommitCheckpoint func(checkpoint []byte) (published bool, err error) + type Cursor struct + Identity DocumentIdentity + Version yin.VersionVector + type DeltaArtifact struct + Identity DocumentIdentity + Payload []byte + type DocumentIdentity struct + DocumentID string + Generation uint64 + type JSONFile struct + func NewJSONFile(replica yin.ReplicaID) (*JSONFile, error) + func ParseJSONFile(replica yin.ReplicaID, data []byte) (*JSONFile, error) + func ParseJSONFileSnapshot(replica yin.ReplicaID, data []byte) (*JSONFile, error) + func (f *JSONFile) Delete(key string) + func (f *JSONFile) Marshal() ([]byte, error) + func (f *JSONFile) MarshalSnapshot() ([]byte, error) + func (f *JSONFile) Set(key string, value json.RawMessage) error + func (f *JSONFile) Version() yin.VersionVector + type Session struct + func NewSession(file *JSONFile) *Session + func NewSessionForDocument(file *JSONFile, identity DocumentIdentity) *Session + func (s *Session) ApplyDeltaFrom(peer yin.ReplicaID, artifact DeltaArtifact) (bool, error) + func (s *Session) Cursor(peer yin.ReplicaID) Cursor + func (s *Session) ExtractDeltaFor(peer yin.ReplicaID) (DeltaArtifact, bool, error) + func (s *Session) ExtractDeltaSince(cursor Cursor) (DeltaArtifact, bool, error) + func (s *Session) Mark(peer yin.ReplicaID, cursor Cursor) error + func (s *Session) SetCursor(peer yin.ReplicaID, cursor Cursor) error + type SnapshotArtifact struct + FormatVersion int + Identity DocumentIdentity + Payload []byte + type Store struct + func NewStore(replica yin.ReplicaID) (*Store, error) + func NewStoreForDocument(replica yin.ReplicaID, identity DocumentIdentity) (*Store, error) + func NewStoreFromJSONFile(replica yin.ReplicaID, file *JSONFile) (*Store, error) + func OpenDurableStore(replica yin.ReplicaID, expectedIdentity DocumentIdentity, ...) (*Store, error) + func OpenStore(replica yin.ReplicaID, dataDir, visiblePath string) (*Store, error) + func OpenStoreForDocument(replica yin.ReplicaID, identity DocumentIdentity, dataDir, visiblePath string) (*Store, error) + func (s *Store) ApplyCatchUp(catchUp CatchUp) (bool, error) + func (s *Store) ApplyDeltaArtifact(artifact DeltaArtifact) (bool, error) + func (s *Store) Bootstrap(artifact SnapshotArtifact) (bool, error) + func (s *Store) CatchUp(cursor Cursor) (CatchUp, error) + func (s *Store) Cursor() Cursor + func (s *Store) Delete(key string) error + func (s *Store) ExportVisibleJSON() ([]byte, error) + func (s *Store) Identity() DocumentIdentity + func (s *Store) ImportVisibleJSON(data []byte) (bool, error) + func (s *Store) ReplicaID() yin.ReplicaID + func (s *Store) RotateCheckpoint() (DocumentIdentity, error) + func (s *Store) Set(key string, value json.RawMessage) error + func (s *Store) Snapshot() (SnapshotArtifact, error) + func (s *Store) Version() yin.VersionVector