mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-04 21:17:37 +03:00
40 lines
819 B
Go
40 lines
819 B
Go
//+build wireinject
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/cloudsonic/sonic-server/api"
|
|
"github.com/cloudsonic/sonic-server/engine"
|
|
"github.com/cloudsonic/sonic-server/itunesbridge"
|
|
"github.com/cloudsonic/sonic-server/persistence/db_ledis"
|
|
"github.com/cloudsonic/sonic-server/persistence/db_storm"
|
|
"github.com/cloudsonic/sonic-server/scanner"
|
|
"github.com/deluan/gomate"
|
|
"github.com/deluan/gomate/ledis"
|
|
"github.com/google/wire"
|
|
)
|
|
|
|
var allProviders = wire.NewSet(
|
|
itunesbridge.NewItunesControl,
|
|
//db_ledis.Set,
|
|
db_storm.Set,
|
|
engine.Set,
|
|
scanner.Set,
|
|
newDB,
|
|
api.NewRouter,
|
|
)
|
|
|
|
func createApp(musicFolder string) *App {
|
|
panic(wire.Build(
|
|
NewApp,
|
|
allProviders,
|
|
))
|
|
}
|
|
|
|
func initRouter() *api.Router {
|
|
panic(wire.Build(allProviders))
|
|
}
|
|
|
|
func newDB() gomate.DB {
|
|
return ledis.NewEmbeddedDB(db_ledis.Db())
|
|
}
|