Rename app package to nativeapi

This commit is contained in:
Deluan
2021-06-13 19:15:41 -04:00
parent 03efc48137
commit d54129ecd2
9 changed files with 68 additions and 58 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ func startServer() (func() error, func(err error)) {
return func() error {
a := CreateServer(conf.Server.MusicFolder)
a.MountRouter("Subsonic API", consts.URLPathSubsonicAPI, CreateSubsonicAPIRouter())
a.MountRouter("Native API", consts.URLPathNativeAPI, CreateAppRouter())
a.MountRouter("Native API", consts.URLPathNativeAPI, CreateNativeAPIRouter())
return a.Run(fmt.Sprintf("%s:%d", conf.Server.Address, conf.Server.Port))
}, func(err error) {
if err != nil {
+4 -4
View File
@@ -15,8 +15,8 @@ import (
"github.com/navidrome/navidrome/scanner"
"github.com/navidrome/navidrome/scheduler"
"github.com/navidrome/navidrome/server"
"github.com/navidrome/navidrome/server/app"
"github.com/navidrome/navidrome/server/events"
"github.com/navidrome/navidrome/server/nativeapi"
"github.com/navidrome/navidrome/server/subsonic"
)
@@ -28,11 +28,11 @@ func CreateServer(musicFolder string) *server.Server {
return serverServer
}
func CreateAppRouter() *app.Router {
func CreateNativeAPIRouter() *nativeapi.Router {
dataStore := persistence.New()
broker := GetBroker()
share := core.NewShare(dataStore)
router := app.New(dataStore, broker, share)
router := nativeapi.New(dataStore, broker, share)
return router
}
@@ -74,7 +74,7 @@ func createScheduler() scheduler.Scheduler {
// wire_injectors.go:
var allProviders = wire.NewSet(core.Set, subsonic.New, app.New, persistence.New, GetBroker)
var allProviders = wire.NewSet(core.Set, subsonic.New, nativeapi.New, persistence.New, GetBroker)
// Scanner must be a Singleton
var (
+3 -3
View File
@@ -11,15 +11,15 @@ import (
"github.com/navidrome/navidrome/scanner"
"github.com/navidrome/navidrome/scheduler"
"github.com/navidrome/navidrome/server"
"github.com/navidrome/navidrome/server/app"
"github.com/navidrome/navidrome/server/events"
"github.com/navidrome/navidrome/server/nativeapi"
"github.com/navidrome/navidrome/server/subsonic"
)
var allProviders = wire.NewSet(
core.Set,
subsonic.New,
app.New,
nativeapi.New,
persistence.New,
GetBroker,
)
@@ -31,7 +31,7 @@ func CreateServer(musicFolder string) *server.Server {
))
}
func CreateAppRouter() *app.Router {
func CreateNativeAPIRouter() *nativeapi.Router {
panic(wire.Build(
allProviders,
))