diff options
author | Michael Muré <batolettre@gmail.com> | 2020-10-04 20:45:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-04 20:45:42 +0200 |
commit | 68e2a72b2a3047d84aba44f22751fb13b34553c1 (patch) | |
tree | 6e1496a1a6603abbd473cc0060a5acebc763a68b /cache/resolvers.go | |
parent | d56ce3d5d9f5ef74201a8ee7c25be4820d435b47 (diff) | |
parent | ca720f165cb286d4372ad48595e532a2423f2f07 (diff) | |
download | git-bug-68e2a72b2a3047d84aba44f22751fb13b34553c1.tar.gz |
Merge pull request #455 from MichaelMure/bug-loading-fix
cache,bug,identity: structural change
Diffstat (limited to 'cache/resolvers.go')
-rw-r--r-- | cache/resolvers.go | 22 |
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) +} |