fix: bad imports and need to switch to interfaces

This commit is contained in:
Derrick Hammer 2024-01-29 22:31:05 -05:00
parent 715980fd1b
commit b49dd976b5
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 17 additions and 16 deletions

View File

@ -6,6 +6,7 @@ import (
"git.lumeweb.com/LumeWeb/libs5-go/protocol"
"git.lumeweb.com/LumeWeb/libs5-go/protocol/signed"
"git.lumeweb.com/LumeWeb/libs5-go/service"
_default "git.lumeweb.com/LumeWeb/libs5-go/service/default"
bolt "go.etcd.io/bbolt"
"go.uber.org/zap"
)
@ -79,10 +80,10 @@ func DefaultNode(config *config.NodeConfig) *Node {
}
// Initialize services first
p2pService := service.NewP2P(params)
registryService := service.NewRegistry(params)
httpService := service.NewHTTP(params)
storageService := service.NewStorage(params)
p2pService := _default.NewP2P(params)
registryService := _default.NewRegistry(params)
httpService := _default.NewHTTP(params)
storageService := _default.NewStorage(params)
// Aggregate services
services := NewServices(ServicesParams{

View File

@ -9,25 +9,25 @@ var (
)
type ServicesParams struct {
P2P *service.P2PService
Registry *service.RegistryService
HTTP *service.HTTPService
Storage *service.StorageService
P2P service.P2PService
Registry service.RegistryService
HTTP service.HTTPService
Storage service.StorageService
}
type ServicesImpl struct {
p2p *service.P2PService
registry *service.RegistryService
http *service.HTTPService
storage *service.StorageService
p2p service.P2PService
registry service.RegistryService
http service.HTTPService
storage service.StorageService
started bool
}
func (s *ServicesImpl) HTTP() *service.HTTPService {
func (s *ServicesImpl) HTTP() service.HTTPService {
return s.http
}
func (s *ServicesImpl) Storage() *service.StorageService {
func (s *ServicesImpl) Storage() service.StorageService {
return s.storage
}
@ -41,7 +41,7 @@ func (s *ServicesImpl) All() []service.Service {
return services
}
func (s *ServicesImpl) Registry() *service.RegistryService {
func (s *ServicesImpl) Registry() service.RegistryService {
return s.registry
}
@ -61,7 +61,7 @@ func NewServices(params ServicesParams) service.Services {
return sc
}
func (s *ServicesImpl) P2P() *service.P2PService {
func (s *ServicesImpl) P2P() service.P2PService {
return s.p2p
}