mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 17:51:44 +03:00
22 lines
492 B
Go
22 lines
492 B
Go
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)
|
|
}
|