Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Document Event Update struct #2598

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions events/db_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,24 @@ type UpdateChannel = immutable.Option[Channel[Update]]
// EmptyUpdateChannel is an empty UpdateChannel.
var EmptyUpdateChannel = immutable.None[Channel[Update]]()

// UpdateEvent represents a new DAG node added to the append-only MerkleCRDT Clock graph
// of a document or sub-field.
// UpdateEvent represents a new DAG node added to the append-only composite MerkleCRDT Clock graph
// of a document.
//
// It must only contain public elements not protected by ACP.
type Update struct {
DocID string
Cid cid.Cid
// DocID is the unique immutable identifier of the document that was updated.
DocID string

// Cid is the id of the composite commit that formed this update in the DAG.
Cid cid.Cid

// SchemaRoot is the root identifier of the schema that defined the shape of the document that was updated.
SchemaRoot string
Block ipld.Node
Priority uint64

// Block is the contents of this composite commit, it contains the Cids of the field level commits that
// also formed this update.
Block ipld.Node

// Priority is used to determine the order in which concurrent updates are applied.
Priority uint64
}
Loading