aboutsummaryrefslogtreecommitdiffstats
path: root/cache/resolvers.go
blob: 36b70d3be99835417bf8763964a520ce4fea3fb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
}