import "github.com/byte-mug/golibs/versionvector"
An implementation of the Version vector technique for distributed systems.
A Version vector is a set of key value pairs, where the key IDENTIFIES the Node modifying the data item, and the value is the version. If a key value-pair with a given key does not exist, 0 is the default value.
Two Nodes MUST NOT have the same key and the key SHOULD NOT change over the lifetime of the Node.
The algorithm is capable to detect Conflicts but it is not capable to resolve conflicts that occured.
type Comparison uint
-
func GetComparison(lower, higher bool) Comparison
-
func (c Comparison) AsInt() int
-
func (c Comparison) Conflict() bool
-
func (c Comparison) Higher() bool
-
func (c Comparison) Lower() bool
-
func (c Comparison) String() string
-
type IntVector []uint64 A Version vector with integers as node-IDs.
func (v IntVector) Compare(other IntVector) Comparison
-
func (v IntVector) Increment(node uint64) IntVector Increments the node's version and returns the new vector.
type Vector map[string]uint64 A Version vector with strings as node-IDs.
func (v Vector) Clone() Vector
-
func (v Vector) Compare(other Vector) Comparison
-
func (v Vector) Increment(node string)
-