Basic DI (dependency injection) working! Yay!!
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"github.com/deluan/gosonic/repositories"
|
||||
"github.com/deluan/gosonic/utils"
|
||||
"github.com/karlkfi/inject"
|
||||
)
|
||||
|
||||
var (
|
||||
indexRepository repositories.ArtistIndex
|
||||
)
|
||||
|
||||
func init () {
|
||||
utils.Graph.Define(&indexRepository, inject.NewProvider(repositories.NewArtistIndexRepository))
|
||||
}
|
||||
Reference in New Issue
Block a user