diff options
Diffstat (limited to 'identity/resolver.go')
-rw-r--r-- | identity/resolver.go | 13 |
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 +} |