aboutsummaryrefslogtreecommitdiffstats
path: root/bug/resolver.go
diff options
context:
space:
mode:
Diffstat (limited to 'bug/resolver.go')
-rw-r--r--bug/resolver.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/bug/resolver.go b/bug/resolver.go
new file mode 100644
index 00000000..e7beb0e4
--- /dev/null
+++ b/bug/resolver.go
@@ -0,0 +1,21 @@
+package bug
+
+import (
+ "github.com/MichaelMure/git-bug/entity"
+ "github.com/MichaelMure/git-bug/repository"
+)
+
+var _ entity.Resolver = &SimpleResolver{}
+
+// SimpleResolver is a Resolver loading Bugs directly from a Repo
+type SimpleResolver struct {
+ repo repository.ClockedRepo
+}
+
+func NewSimpleResolver(repo repository.ClockedRepo) *SimpleResolver {
+ return &SimpleResolver{repo: repo}
+}
+
+func (r *SimpleResolver) Resolve(id entity.Id) (entity.Interface, error) {
+ return Read(r.repo, id)
+}