mirror of
https://github.com/mariocandela/beelzebub.git
synced 2025-07-01 18:47:26 -04:00
Injected tracer dependency into protocolManager.go
This commit is contained in:
@ -1,13 +1,19 @@
|
|||||||
package protocols
|
package protocols
|
||||||
|
|
||||||
import "beelzebub/parser"
|
import (
|
||||||
|
"beelzebub/parser"
|
||||||
|
"beelzebub/tracer"
|
||||||
|
)
|
||||||
|
|
||||||
type ProtocolManager struct {
|
type ProtocolManager struct {
|
||||||
strategy ServiceStrategy
|
strategy ServiceStrategy
|
||||||
|
tracer *tracer.Tracer
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pm *ProtocolManager) InitServiceManager() *ProtocolManager {
|
func (pm *ProtocolManager) InitServiceManager() *ProtocolManager {
|
||||||
return &ProtocolManager{}
|
return &ProtocolManager{
|
||||||
|
tracer: tracer.Init(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (pm *ProtocolManager) SetProtocolStrategy(strategy ServiceStrategy) {
|
func (pm *ProtocolManager) SetProtocolStrategy(strategy ServiceStrategy) {
|
||||||
@ -15,5 +21,5 @@ func (pm *ProtocolManager) SetProtocolStrategy(strategy ServiceStrategy) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (pm *ProtocolManager) InitService(beelzebubServiceConfiguration parser.BeelzebubServiceConfiguration) error {
|
func (pm *ProtocolManager) InitService(beelzebubServiceConfiguration parser.BeelzebubServiceConfiguration) error {
|
||||||
return pm.strategy.Init(beelzebubServiceConfiguration)
|
return pm.strategy.Init(beelzebubServiceConfiguration, *pm.tracer)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user