Sync / API

foldkit-sync/entity

foldkit-sync/entity: edits to rows a server owns, kept in a replicated slice that the journal owns. foldkit-sync/remote shows them over the rows Remote reads.

The journal orders the edits and stamps each with the sequence it committed at (at) and who committed it from where (by); the table is the journal's read model, each row carrying the highest sequence it has applied (revision). An edit the table holds is absorbed: the server says so (absorbed), every replica drops it, and the journal compacts.

Everything here is pure: it owns no state, does no I/O, and sends nothing. The application keeps the edits in its Model and calls these from update, the stamp, and Sync.mount's onReinstall.

Namespaces

EditableEntityEdits to an Entity's members, kept per cell in a replicated slice and laid over its rows.

Values

AuthorWho committed an edit: the actor, shown in words, and the replica (a tab), which says whose it is.

Interfaces

EntityFieldsWhat make reads of an Entity: each member's schema, id among them.
ReplacedA cell this replica last wrote that a later edit replaced: its edit, and what the cell holds now.

Types

CellEditA cell's edit as the slice keeps it: committed at by by, or, with neither, pending.
ChangeOne cell's new value: the member and a value of that member's type, together.
MemberThe members an edit can change: every field but id.
RowOfA row as the table holds it: its id, the revision it has applied, and its members.