aboutsummaryrefslogtreecommitdiffstats
path: root/util/lamport/lamport.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-24 12:46:39 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-24 12:46:39 +0200
commitc3a5213f829444452e1971822529a57da613831d (patch)
treecc5aa403b75428e9ebbde1e0bf62e55eec25a11d /util/lamport/lamport.go
parent921cd18cf98ecfc1f7fa82f57d64f1b1f9077e64 (diff)
downloadgit-bug-c3a5213f829444452e1971822529a57da613831d.tar.gz
repo: more documentation
Diffstat (limited to 'util/lamport/lamport.go')
-rw-r--r--util/lamport/lamport.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/lamport/lamport.go b/util/lamport/lamport.go
index 640c58bc..0372bb6f 100644
--- a/util/lamport/lamport.go
+++ b/util/lamport/lamport.go
@@ -41,12 +41,15 @@ type Clock struct {
// Time is the value of a Clock.
type Time uint64
+// NewClock create a new clock with the value 1.
+// Value 0 is considered as invalid.
func NewClock() Clock {
return Clock{
counter: 1,
}
}
+// NewClockWithTime create a new clock with a value.
func NewClockWithTime(time uint64) Clock {
return Clock{
counter: time,