Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Set ¶
func Set(hlc HybridLogicalClock) error
Set syncs the global HLC instance to the given HLC.
Types ¶
type HybridLogicalClock ¶
HybridLogicalClock provides a combination of physical and logical clocks used to track timestamps across a distributed system.
func Get ¶
func Get() (HybridLogicalClock, error)
Get syncs the global HLC instance to the current time and returns it.
func Parse ¶
func Parse(name, value string) (HybridLogicalClock, error)
Parse the HLC from a string.
func (HybridLogicalClock) Compare ¶
func (hlc HybridLogicalClock) Compare(other HybridLogicalClock) int
Compare this HLC value with another one.
func (HybridLogicalClock) IsZero ¶
func (hlc HybridLogicalClock) IsZero() bool
IsZero returns whether this HLC matches its zero value.
func (HybridLogicalClock) String ¶
func (hlc HybridLogicalClock) String() string
String retrieves a serialized form of the HLC.
func (HybridLogicalClock) Update ¶
func (hlc HybridLogicalClock) Update( other HybridLogicalClock, ) (HybridLogicalClock, error)
Update an HLC based on another one and return the new value.
Click to show internal directories.
Click to hide internal directories.