fix: don't try to embed service.ServiceParams

This commit is contained in:
Derrick Hammer 2024-01-30 14:16:16 -05:00
parent df3f7e24bb
commit 2201b5cb07
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 26 additions and 5 deletions

View File

@ -1,10 +1,13 @@
package fx package fx
import ( import (
"git.lumeweb.com/LumeWeb/libs5-go/config"
"git.lumeweb.com/LumeWeb/libs5-go/node" "git.lumeweb.com/LumeWeb/libs5-go/node"
"git.lumeweb.com/LumeWeb/libs5-go/service" "git.lumeweb.com/LumeWeb/libs5-go/service"
_default "git.lumeweb.com/LumeWeb/libs5-go/service/default" _default "git.lumeweb.com/LumeWeb/libs5-go/service/default"
"go.etcd.io/bbolt"
"go.uber.org/fx" "go.uber.org/fx"
"go.uber.org/zap"
) )
var Module = fx.Module("libs5", var Module = fx.Module("libs5",
@ -18,7 +21,9 @@ var Module = fx.Module("libs5",
type ServiceParams struct { type ServiceParams struct {
fx.In fx.In
service.ServiceParams Logger *zap.Logger
Config *config.NodeConfig
Db *bbolt.DB
} }
type ServicesParams struct { type ServicesParams struct {
@ -30,18 +35,34 @@ type ServicesParams struct {
} }
func newP2P(params ServiceParams) service.P2PService { func newP2P(params ServiceParams) service.P2PService {
return _default.NewP2P(params.ServiceParams) return _default.NewP2P(service.ServiceParams{
Logger: params.Logger,
Config: params.Config,
Db: params.Db,
})
} }
func newRegistry(params ServiceParams) service.RegistryService { func newRegistry(params ServiceParams) service.RegistryService {
return _default.NewRegistry(params.ServiceParams) return _default.NewRegistry(service.ServiceParams{
Logger: params.Logger,
Config: params.Config,
Db: params.Db,
})
} }
func newHTTP(params ServiceParams) service.HTTPService { func newHTTP(params ServiceParams) service.HTTPService {
return _default.NewHTTP(params.ServiceParams) return _default.NewHTTP(service.ServiceParams{
Logger: params.Logger,
Config: params.Config,
Db: params.Db,
})
} }
func newStorage(params ServiceParams) service.StorageService { func newStorage(params ServiceParams) service.StorageService {
return _default.NewStorage(params.ServiceParams) return _default.NewStorage(service.ServiceParams{
Logger: params.Logger,
Config: params.Config,
Db: params.Db,
})
} }
func newServices(params ServicesParams) service.Services { func newServices(params ServicesParams) service.Services {