aboutsummaryrefslogtreecommitdiffstats
path: root/cache/cached.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-12-21 21:54:36 +0100
committerMichael Muré <batolettre@gmail.com>2022-12-21 21:54:36 +0100
commit9b98fc06489353053564b431ac0c0d73a5c55a56 (patch)
tree67cab95c0c6167c0982516a2dda610bd5ece9eab /cache/cached.go
parent905c9a90f134842b97e2cf729d8b11ff59bfd766 (diff)
downloadgit-bug-9b98fc06489353053564b431ac0c0d73a5c55a56.tar.gz
cache: tie up the refactor up to compiling
Diffstat (limited to 'cache/cached.go')
-rw-r--r--cache/cached.go16
1 files changed, 14 insertions, 2 deletions
diff --git a/cache/cached.go b/cache/cached.go
index 74757356..5a31ee59 100644
--- a/cache/cached.go
+++ b/cache/cached.go
@@ -3,10 +3,10 @@ package cache
import (
"sync"
- "github.com/MichaelMure/git-bug/entities/bug"
"github.com/MichaelMure/git-bug/entity"
"github.com/MichaelMure/git-bug/entity/dag"
"github.com/MichaelMure/git-bug/repository"
+ "github.com/MichaelMure/git-bug/util/lamport"
)
// type withSnapshot[SnapT dag.Snapshot, OpT dag.OperationWithApply[SnapT]] struct {
@@ -97,7 +97,7 @@ func (e *CachedEntityBase[SnapT, OpT]) ResolveOperationWithMetadata(key string,
}
if len(matching) > 1 {
- return "", bug.NewErrMultipleMatchOp(matching)
+ return "", entity.NewErrMultipleMatch("operation", matching)
}
return matching[0], nil
@@ -136,3 +136,15 @@ func (e *CachedEntityBase[SnapT, OpT]) NeedCommit() bool {
defer e.mu.RUnlock()
return e.entity.NeedCommit()
}
+
+func (e *CachedEntityBase[SnapT, OpT]) CreateLamportTime() lamport.Time {
+ return e.entity.CreateLamportTime()
+}
+
+func (e *CachedEntityBase[SnapT, OpT]) EditLamportTime() lamport.Time {
+ return e.entity.EditLamportTime()
+}
+
+func (e *CachedEntityBase[SnapT, OpT]) FirstOp() OpT {
+ return e.entity.FirstOp()
+}