aboutsummaryrefslogtreecommitdiffstats
path: root/entities/bug/resolver.go
blob: b0a0591760ef97466b67087f72fb91177e56c198 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.Resolved, error) {
	return Read(r.repo, id)
}