Documentation ¶
Index ¶
- type Condition
- type VClock
- func (vc VClock) Bytes() []byte
- func (vc VClock) Compare(other VClock, cond Condition) bool
- func (vc VClock) Copy() VClock
- func (vc VClock) CopyFromMap(otherMap map[string]uint64) VClock
- func (vc VClock) FindTicks(id string) (uint64, bool)
- func (vc VClock) GetMap() map[string]uint64
- func (vc VClock) LastUpdate() (last uint64)
- func (vc VClock) Merge(other VClock)
- func (vc VClock) PrintVC()
- func (vc VClock) ReturnVCString() string
- func (vc VClock) Set(id string, ticks uint64)
- func (vc VClock) Tick(id string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶
type Condition int
Condition constants define how to compare a vector clock against another, and may be ORed together when being provided to the Compare method.
type VClock ¶
VClock are maps of string to uint64 where the string is the id of the process, and the uint64 is the clock value
func (VClock) Compare ¶
Compare takes another clock and determines if it is Equal, Ancestor, Descendant, or Concurrent with the callee's clock.
func (VClock) CopyFromMap ¶
CopyFromMap copies a map to a vector clock
func (VClock) FindTicks ¶
FindTicks returns the clock value for a given id, if a value is not found false is returned
func (VClock) LastUpdate ¶
LastUpdate returns the clock value of the oldest clock
func (VClock) Merge ¶
Merge takes the max of all clock values in other and updates the values of the callee
func (VClock) PrintVC ¶
func (vc VClock) PrintVC()
PrintVC prints the callee's vector clock to stdout
func (VClock) ReturnVCString ¶
ReturnVCString returns a string encoding of a vector clock