refactor: change Protocol Initialize to take a portal instance

This commit is contained in:
Derrick Hammer 2024-01-12 08:21:41 -05:00
parent 2fb08f35ed
commit b5c540ab8e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
2 changed files with 2 additions and 7 deletions

View File

@ -104,7 +104,7 @@ func (p *PortalImpl) getInitFuncs() []func() error {
},
func() error {
for _, _func := range p.protocolRegistry.All() {
err := _func.Initialize(p.Config(), p.Logger())
err := _func.Initialize(p)
if err != nil {
return err
}

View File

@ -1,11 +1,6 @@
package interfaces
import (
"github.com/spf13/viper"
"go.uber.org/zap"
)
type Protocol interface {
Initialize(config *viper.Viper, logger *zap.Logger) error
Initialize(portal Portal) error
Start() error
}