aboutsummaryrefslogtreecommitdiffstats
path: root/identity/resolver.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-10-04 20:45:42 +0200
committerGitHub <noreply@github.com>2020-10-04 20:45:42 +0200
commit68e2a72b2a3047d84aba44f22751fb13b34553c1 (patch)
tree6e1496a1a6603abbd473cc0060a5acebc763a68b /identity/resolver.go
parentd56ce3d5d9f5ef74201a8ee7c25be4820d435b47 (diff)
parentca720f165cb286d4372ad48595e532a2423f2f07 (diff)
downloadgit-bug-68e2a72b2a3047d84aba44f22751fb13b34553c1.tar.gz
Merge pull request #455 from MichaelMure/bug-loading-fix
cache,bug,identity: structural change
Diffstat (limited to 'identity/resolver.go')
-rw-r--r--identity/resolver.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/identity/resolver.go b/identity/resolver.go
index 70fac74c..ab380a12 100644
--- a/identity/resolver.go
+++ b/identity/resolver.go
@@ -11,7 +11,7 @@ type Resolver interface {
ResolveIdentity(id entity.Id) (Interface, error)
}
-// DefaultResolver is a Resolver loading Identities directly from a Repo
+// SimpleResolver is a Resolver loading Identities directly from a Repo
type SimpleResolver struct {
repo repository.Repo
}
@@ -23,3 +23,14 @@ func NewSimpleResolver(repo repository.Repo) *SimpleResolver {
func (r *SimpleResolver) ResolveIdentity(id entity.Id) (Interface, error) {
return ReadLocal(r.repo, id)
}
+
+// StubResolver is a Resolver that doesn't load anything, only returning IdentityStub instances
+type StubResolver struct{}
+
+func NewStubResolver() *StubResolver {
+ return &StubResolver{}
+}
+
+func (s *StubResolver) ResolveIdentity(id entity.Id) (Interface, error) {
+ return &IdentityStub{id: id}, nil
+}