-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdelta.go
More file actions
24 lines (22 loc) · 1.1 KB
/
Copy pathdelta.go
File metadata and controls
24 lines (22 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package yin
// Delta is the non-generic public seam for document catch-up payloads.
//
// A Delta implementation must carry all state needed to reconstruct and apply
// the represented document update for its concrete CRDT kind. The interface is
// intentionally small: Kind identifies the concrete delta family for routing or
// a future codec, and Version describes the causal state covered by the delta.
// Yin does not define a concrete wire encoding here; codecs should translate
// concrete delta implementations at this seam without changing Document.
type Delta interface {
// Kind returns a stable type tag for the concrete delta family.
//
// ApplyDelta implementations and future serialization codecs use this tag to
// route heterogeneous deltas without making the public Delta interface
// generic. Kind is not itself a wire format.
Kind() string
// Version returns the causal state fully represented by this delta.
//
// The returned VersionVector lets receivers and codecs reason about catch-up
// coverage while the concrete delta still owns its reconstructable payload.
Version() VersionVector
}