2020-01-08 15:39:58 +01:00
|
|
|
//+build wireinject
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2020-01-11 18:37:05 +01:00
|
|
|
"github.com/cloudsonic/sonic-server/api"
|
2020-01-08 15:39:58 +01:00
|
|
|
"github.com/cloudsonic/sonic-server/engine"
|
|
|
|
"github.com/cloudsonic/sonic-server/itunesbridge"
|
2020-01-15 00:23:29 +01:00
|
|
|
"github.com/cloudsonic/sonic-server/persistence"
|
2020-01-15 03:51:35 +01:00
|
|
|
"github.com/cloudsonic/sonic-server/scanner_legacy"
|
2020-01-13 23:06:47 +01:00
|
|
|
"github.com/cloudsonic/sonic-server/server"
|
2020-01-08 15:39:58 +01:00
|
|
|
"github.com/google/wire"
|
|
|
|
)
|
|
|
|
|
|
|
|
var allProviders = wire.NewSet(
|
|
|
|
itunesbridge.NewItunesControl,
|
|
|
|
engine.Set,
|
2020-01-15 03:51:35 +01:00
|
|
|
scanner_legacy.Set,
|
2020-01-11 18:37:05 +01:00
|
|
|
api.NewRouter,
|
2020-01-15 23:51:17 +01:00
|
|
|
persistence.Set,
|
2020-01-08 15:39:58 +01:00
|
|
|
)
|
|
|
|
|
2020-01-13 23:06:47 +01:00
|
|
|
func CreateApp(musicFolder string) *server.Server {
|
2020-01-11 19:00:03 +01:00
|
|
|
panic(wire.Build(
|
2020-01-13 23:06:47 +01:00
|
|
|
server.New,
|
2020-01-11 19:00:03 +01:00
|
|
|
allProviders,
|
|
|
|
))
|
2020-01-11 18:37:05 +01:00
|
|
|
}
|
|
|
|
|
2020-01-13 22:37:24 +01:00
|
|
|
func CreateSubsonicAPIRouter() *api.Router {
|
2020-01-08 15:39:58 +01:00
|
|
|
panic(wire.Build(allProviders))
|
|
|
|
}
|