navidrome/cmd/wire_injectors.go
Kendall Garner 3179966270
fix(metrics): write system metrics on start (#3641)
* fix(metrics): write system metrics on start

* add broken basic auth test

* refactor: simplify Prometheus instantiation

Signed-off-by: Deluan <deluan@navidrome.org>

* fix: basic authentication

Signed-off-by: Deluan <deluan@navidrome.org>

* refactor: move magic strings to constants

Signed-off-by: Deluan <deluan@navidrome.org>

* refactor: simplify prometheus http handler

Signed-off-by: Deluan <deluan@navidrome.org>

* add artist metadata to aggregrate sql

---------

Signed-off-by: Deluan <deluan@navidrome.org>
Co-authored-by: Deluan <deluan@navidrome.org>
2025-01-11 21:02:36 -05:00

97 lines
1.8 KiB
Go

//go:build wireinject
package cmd
import (
"github.com/google/wire"
"github.com/navidrome/navidrome/core"
"github.com/navidrome/navidrome/core/agents/lastfm"
"github.com/navidrome/navidrome/core/agents/listenbrainz"
"github.com/navidrome/navidrome/core/artwork"
"github.com/navidrome/navidrome/core/metrics"
"github.com/navidrome/navidrome/core/playback"
"github.com/navidrome/navidrome/db"
"github.com/navidrome/navidrome/persistence"
"github.com/navidrome/navidrome/scanner"
"github.com/navidrome/navidrome/server"
"github.com/navidrome/navidrome/server/events"
"github.com/navidrome/navidrome/server/nativeapi"
"github.com/navidrome/navidrome/server/public"
"github.com/navidrome/navidrome/server/subsonic"
)
var allProviders = wire.NewSet(
core.Set,
artwork.Set,
server.New,
subsonic.New,
nativeapi.New,
public.New,
persistence.New,
lastfm.NewRouter,
listenbrainz.NewRouter,
events.GetBroker,
scanner.GetInstance,
db.Db,
metrics.NewPrometheusInstance,
)
func CreateServer(musicFolder string) *server.Server {
panic(wire.Build(
allProviders,
))
}
func CreateNativeAPIRouter() *nativeapi.Router {
panic(wire.Build(
allProviders,
))
}
func CreateSubsonicAPIRouter() *subsonic.Router {
panic(wire.Build(
allProviders,
))
}
func CreatePublicRouter() *public.Router {
panic(wire.Build(
allProviders,
))
}
func CreateLastFMRouter() *lastfm.Router {
panic(wire.Build(
allProviders,
))
}
func CreateListenBrainzRouter() *listenbrainz.Router {
panic(wire.Build(
allProviders,
))
}
func CreateInsights() metrics.Insights {
panic(wire.Build(
allProviders,
))
}
func CreatePrometheus() metrics.Metrics {
panic(wire.Build(
allProviders,
))
}
func GetScanner() scanner.Scanner {
panic(wire.Build(
allProviders,
))
}
func GetPlaybackServer() playback.PlaybackServer {
panic(wire.Build(
allProviders,
))
}