fix: bad imports and need to switch to interfaces
This commit is contained in:
parent
715980fd1b
commit
b49dd976b5
|
@ -6,6 +6,7 @@ import (
|
||||||
"git.lumeweb.com/LumeWeb/libs5-go/protocol"
|
"git.lumeweb.com/LumeWeb/libs5-go/protocol"
|
||||||
"git.lumeweb.com/LumeWeb/libs5-go/protocol/signed"
|
"git.lumeweb.com/LumeWeb/libs5-go/protocol/signed"
|
||||||
"git.lumeweb.com/LumeWeb/libs5-go/service"
|
"git.lumeweb.com/LumeWeb/libs5-go/service"
|
||||||
|
_default "git.lumeweb.com/LumeWeb/libs5-go/service/default"
|
||||||
bolt "go.etcd.io/bbolt"
|
bolt "go.etcd.io/bbolt"
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
@ -79,10 +80,10 @@ func DefaultNode(config *config.NodeConfig) *Node {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize services first
|
// Initialize services first
|
||||||
p2pService := service.NewP2P(params)
|
p2pService := _default.NewP2P(params)
|
||||||
registryService := service.NewRegistry(params)
|
registryService := _default.NewRegistry(params)
|
||||||
httpService := service.NewHTTP(params)
|
httpService := _default.NewHTTP(params)
|
||||||
storageService := service.NewStorage(params)
|
storageService := _default.NewStorage(params)
|
||||||
|
|
||||||
// Aggregate services
|
// Aggregate services
|
||||||
services := NewServices(ServicesParams{
|
services := NewServices(ServicesParams{
|
||||||
|
|
|
@ -9,25 +9,25 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServicesParams struct {
|
type ServicesParams struct {
|
||||||
P2P *service.P2PService
|
P2P service.P2PService
|
||||||
Registry *service.RegistryService
|
Registry service.RegistryService
|
||||||
HTTP *service.HTTPService
|
HTTP service.HTTPService
|
||||||
Storage *service.StorageService
|
Storage service.StorageService
|
||||||
}
|
}
|
||||||
|
|
||||||
type ServicesImpl struct {
|
type ServicesImpl struct {
|
||||||
p2p *service.P2PService
|
p2p service.P2PService
|
||||||
registry *service.RegistryService
|
registry service.RegistryService
|
||||||
http *service.HTTPService
|
http service.HTTPService
|
||||||
storage *service.StorageService
|
storage service.StorageService
|
||||||
started bool
|
started bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ServicesImpl) HTTP() *service.HTTPService {
|
func (s *ServicesImpl) HTTP() service.HTTPService {
|
||||||
return s.http
|
return s.http
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ServicesImpl) Storage() *service.StorageService {
|
func (s *ServicesImpl) Storage() service.StorageService {
|
||||||
return s.storage
|
return s.storage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ func (s *ServicesImpl) All() []service.Service {
|
||||||
return services
|
return services
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ServicesImpl) Registry() *service.RegistryService {
|
func (s *ServicesImpl) Registry() service.RegistryService {
|
||||||
return s.registry
|
return s.registry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ func NewServices(params ServicesParams) service.Services {
|
||||||
return sc
|
return sc
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ServicesImpl) P2P() *service.P2PService {
|
func (s *ServicesImpl) P2P() service.P2PService {
|
||||||
return s.p2p
|
return s.p2p
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue