Documentation
¶
Overview ¶
Package clock implements a hybrid logical clock for CRDT mutation tags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidReplicaID indicates that a clock was created without a usable // logical replica identifier. ErrInvalidReplicaID = errors.New("clock: invalid replica ID") // ErrInvalidRemoteTag indicates that Witness received an invalid tag. ErrInvalidRemoteTag = errors.New("clock: invalid remote tag") // ErrClockExhausted indicates that the complete tag space is exhausted. ErrClockExhausted = errors.New("clock: timestamp space exhausted") )
Functions ¶
This section is empty.
Types ¶
type HLC ¶
type HLC struct {
// contains filtered or unexported fields
}
HLC generates monotonically ordered tags for one logical replica.
A caller that reuses its replica ID after a process restart must persist and restore the clock state. Otherwise it must use a fresh replica ID.
func NewHLCFromState ¶
NewHLCFromState restores a clock that previously used State.ReplicaID.
Click to show internal directories.
Click to hide internal directories.