diff options
author | Michael Muré <batolettre@gmail.com> | 2020-11-08 17:54:28 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2021-02-14 12:15:41 +0100 |
commit | fb0c5fd06184f33a03d8d4fb29a3aef8b1dafe78 (patch) | |
tree | a0d87d04a991368840645591f11284b7ea27160c /repository/repo.go | |
parent | 44d7587940f842a343a64d9107601591bdfb1027 (diff) | |
download | git-bug-fb0c5fd06184f33a03d8d4fb29a3aef8b1dafe78.tar.gz |
repo: expose all lamport clocks, move clocks in their own folder
Diffstat (limited to 'repository/repo.go')
-rw-r--r-- | repository/repo.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/repository/repo.go b/repository/repo.go index eb9296d4..625e0143 100644 --- a/repository/repo.go +++ b/repository/repo.go @@ -22,9 +22,9 @@ type Repo interface { RepoConfig RepoKeyring RepoCommon - RepoData RepoStorage RepoBleve + RepoData Close() error } @@ -142,9 +142,18 @@ type RepoData interface { // RepoClock give access to Lamport clocks type RepoClock interface { + // AllClocks return all the known clocks + AllClocks() (map[string]lamport.Clock, error) + // GetOrCreateClock return a Lamport clock stored in the Repo. // If the clock doesn't exist, it's created. GetOrCreateClock(name string) (lamport.Clock, error) + + // Increment is equivalent to c = GetOrCreateClock(name) + c.Increment() + Increment(name string) (lamport.Time, error) + + // Witness is equivalent to c = GetOrCreateClock(name) + c.Witness(time) + Witness(name string, time lamport.Time) error } // ClockLoader hold which logical clock need to exist for an entity and |