mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-15 02:01:43 +03:00
ca720f165c
- bug doesn't commit identities anymore, only make sure they are commit - cache use an IdentityResolver to load bugs with identities from the cache (deps injection) - IdentityCache now are identity.Interface
23 lines
563 B
Go
23 lines
563 B
Go
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)
|
|
}
|