refactor: change Protocol Initialize to take a portal instance
This commit is contained in:
parent
2fb08f35ed
commit
b5c540ab8e
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue