crdt_lf_hive library
A Hive storage implementation for CRDT (Conflict-free Replicated Data Type) objects.
This library provides Hive adapters and storage utilities for persisting
CRDT objects like Changes and Snapshots, organized by document. It also
stores the PeerId each document writes under, so a reopened document is
the same author it was before.
Classes
- ChangeAdapter
-
Hive adapter for
Changeobjects. - CRDTChangeStorage
-
The
Changes of one document, as a backend keeps them. - CRDTDocumentPersistence
-
Keeps a
CRDTDocumenton disk as it changes. - CRDTDocumentStorage
- Everything one document has on disk: its changes and its snapshots.
- CRDTHive
- Main utility class for initializing Hive with CRDT adapters.
- CRDTHiveBackend
- The CRDTStorageBackend of the Hive adapter.
- CRDTHiveChangeStorage
-
Stores
Changeobjects in a Hive box. - CRDTHiveDocumentStorage
- The changes and snapshots of one document, in two Hive boxes.
- CRDTHivePeerIdStorage
-
Stores the
PeerIdof one document in a Hive box. - CRDTHiveSnapshotStorage
-
Stores
Snapshotobjects in a Hive box. - CRDTPeerIdStorage
-
The
PeerIdthis device writes under, for one document. - CRDTSnapshotStorage
-
The
Snapshots of one document, as a backend keeps them. - CRDTStorageBackend
- Everything one backend holds: the documents, and what each of them is made of.
- SnapshotAdapter
-
Hive adapter for
Snapshotobjects.
Extensions
- CRDTDocumentStorageReading on CRDTDocumentStorage
- Reading a CRDTDocumentStorage without following it, and copying one.
-
CRDTFutureOr
on FutureOr<
T> - Chaining for a value that may or may not be a Future.
- CRDTPeerIdStorageLoad on CRDTPeerIdStorage
- The read-or-mint step every caller of a CRDTPeerIdStorage takes.
- CRDTSnapshotStorageLatest on CRDTSnapshotStorage
- The read-then-pick step a caller of a CRDTSnapshotStorage takes to restore.
- CRDTStorageBackendDocuments on CRDTStorageBackend
- Opening, reading and copying the documents of a CRDTStorageBackend.
Functions
-
documentBoxNameFor(
String prefix, String documentId) → String -
The box name of
documentIdunderprefix. -
escapeForBoxName(
String documentId) → String -
The escaped form of
documentId. See documentBoxNameFor. -
filterByVersion(
List< Change> changes, {VersionVector? newerThan, VersionVector? upTo}) → List<Change> -
Keeps the
changesthat fall inside a version range. -
newestSnapshot(
Iterable< Snapshot> snapshots) → Snapshot? -
The newest of
snapshots, ornullwhen there is none.
Typedefs
- PersistentDocument = ({CRDTDocument document, CRDTDocumentPersistence persistence})
-
A
CRDTDocumentrestored from a backend, and the CRDTDocumentPersistence that keeps writing it.