Started implementing getIndex, now with TDD (brought to you by DI)!

This commit is contained in:
Deluan
2016-03-01 12:35:30 -05:00
parent b2cdf8cadb
commit 2bb4c74ba6
7 changed files with 129 additions and 21 deletions
+2 -7
View File
@@ -1,15 +1,10 @@
package conf
import (
"github.com/deluan/gosonic/repositories"
"github.com/deluan/gosonic/utils"
"github.com/karlkfi/inject"
"github.com/deluan/gosonic/repositories"
)
func define(ptr interface{}, constructor interface{}, argPtrs ...interface{}) {
utils.Graph.Define(ptr, inject.NewProvider(constructor, argPtrs...))
}
func init () {
define(new(repositories.ArtistIndex), repositories.NewArtistIndexRepository)
utils.DefineSingleton(new(repositories.ArtistIndex), repositories.NewArtistIndexRepository)
}