refactor: switch to using Supply

This commit is contained in:
Derrick Hammer 2024-02-17 03:12:44 -05:00
parent 24694ecbae
commit af0f3e19de
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 9 deletions

View File

@ -14,7 +14,6 @@ import (
"git.lumeweb.com/LumeWeb/portal/protocols" "git.lumeweb.com/LumeWeb/portal/protocols"
"git.lumeweb.com/LumeWeb/portal/renter" "git.lumeweb.com/LumeWeb/portal/renter"
"git.lumeweb.com/LumeWeb/portal/storage" "git.lumeweb.com/LumeWeb/portal/storage"
"github.com/spf13/viper"
"go.uber.org/fx" "go.uber.org/fx"
"go.uber.org/fx/fxevent" "go.uber.org/fx/fxevent"
"go.uber.org/zap" "go.uber.org/zap"
@ -52,14 +51,8 @@ func main() {
} }
fx.New( fx.New(
fx.Provide(_logger.NewFallbackLogger), fx.Supply(config),
fx.Provide(func() *viper.Viper { fx.Supply(logger),
return config
}),
fx.Decorate(func() *zap.Logger {
return logger
}),
fxLogger, fxLogger,
fx.Invoke(initCheckRequiredConfig), fx.Invoke(initCheckRequiredConfig),
fx.Provide(NewIdentity), fx.Provide(NewIdentity),