mirror of
https://github.com/navidrome/navidrome.git
synced 2025-04-03 20:47:35 +03:00
50 lines
1.5 KiB
Go
50 lines
1.5 KiB
Go
// Code generated by Wire. DO NOT EDIT.
|
|
|
|
//go:generate wire
|
|
//+build !wireinject
|
|
|
|
package main
|
|
|
|
import (
|
|
"github.com/cloudsonic/sonic-server/engine"
|
|
"github.com/cloudsonic/sonic-server/persistence"
|
|
"github.com/cloudsonic/sonic-server/scanner"
|
|
"github.com/cloudsonic/sonic-server/server"
|
|
"github.com/cloudsonic/sonic-server/server/app"
|
|
"github.com/cloudsonic/sonic-server/server/subsonic"
|
|
"github.com/google/wire"
|
|
)
|
|
|
|
// Injectors from wire_injectors.go:
|
|
|
|
func CreateServer(musicFolder string) *server.Server {
|
|
dataStore := persistence.New()
|
|
scannerScanner := scanner.New(dataStore)
|
|
serverServer := server.New(scannerScanner, dataStore)
|
|
return serverServer
|
|
}
|
|
|
|
func CreateAppRouter(path string) *app.Router {
|
|
dataStore := persistence.New()
|
|
router := app.New(dataStore, path)
|
|
return router
|
|
}
|
|
|
|
func CreateSubsonicAPIRouter() *subsonic.Router {
|
|
dataStore := persistence.New()
|
|
browser := engine.NewBrowser(dataStore)
|
|
cover := engine.NewCover(dataStore)
|
|
nowPlayingRepository := engine.NewNowPlayingRepository()
|
|
listGenerator := engine.NewListGenerator(dataStore, nowPlayingRepository)
|
|
users := engine.NewUsers(dataStore)
|
|
playlists := engine.NewPlaylists(dataStore)
|
|
ratings := engine.NewRatings(dataStore)
|
|
scrobbler := engine.NewScrobbler(dataStore, nowPlayingRepository)
|
|
search := engine.NewSearch(dataStore)
|
|
router := subsonic.New(browser, cover, listGenerator, users, playlists, ratings, scrobbler, search)
|
|
return router
|
|
}
|
|
|
|
// wire_injectors.go:
|
|
|
|
var allProviders = wire.NewSet(engine.Set, scanner.New, subsonic.New, app.New, persistence.New)
|