aboutsummaryrefslogtreecommitdiffstats
path: root/cache/resolvers.go
diff options
context:
space:
mode:
Diffstat (limited to 'cache/resolvers.go')
-rw-r--r--cache/resolvers.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/cache/resolvers.go b/cache/resolvers.go
new file mode 100644
index 00000000..36b70d3b
--- /dev/null
+++ b/cache/resolvers.go
@@ -0,0 +1,22 @@
+package cache
+
+import (
+ "github.com/MichaelMure/git-bug/entity"
+ "github.com/MichaelMure/git-bug/identity"
+)
+
+var _ identity.Resolver = &identityCacheResolver{}
+
+// identityCacheResolver is an identity Resolver that retrieve identities from
+// the cache
+type identityCacheResolver struct {
+ cache *RepoCache
+}
+
+func newIdentityCacheResolver(cache *RepoCache) *identityCacheResolver {
+ return &identityCacheResolver{cache: cache}
+}
+
+func (i *identityCacheResolver) ResolveIdentity(id entity.Id) (identity.Interface, error) {
+ return i.cache.ResolveIdentity(id)
+}