replikativ.crdt.cdvcs.core

Implementing core CDVCS functions purely and value based. All
operations return a new state of the CRDT record and the
corresponding downstream operation for synchronisation.

commit

(commit cdvcs author)
Commits to a CDVCS with a value for a set of parents.
Returns a map with metadata and value+inlined metadata.

fork

(fork remote-state)
Fork (clone) a remote CDVCS as your working copy.

merge

(merge {:keys [state], :as cdvcs} author)(merge {:keys [state], :as cdvcs} author remote-state)(merge {:keys [state], :as cdvcs} author remote-state heads correcting-transactions)
Merge a CDVCS either with itself, or with remote metadata and
optionally supply the order in which parent commits should be
supplied. Otherwise see merge-heads how to get and manipulate them.

merge-heads

(merge-heads meta-a meta-b)
Constructs a vector of heads. You can reorder them.

multiple-heads?

(multiple-heads? meta)
Checks whether CDVCS has multiple heads.

new-cdvcs

(new-cdvcs author)
Create a (unique) CDVCS for an initial value. Returns a map with
new metadata and initial commit value.

pull

(pull cdvcs remote-state remote-tip)(pull {:keys [state], :as cdvcs} remote-state remote-tip allow-induced-conflict? rebase-transactions?)
Pull all commits from remote-tip (only its ancestors).