From 1d0447693533c32c84b2d3ffe552dc7213f267b2 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 9 May 2022 23:19:19 +0200 Subject: [PATCH] Injected tracer dependency into protocolManager.go --- protocols/protocolManager.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/protocols/protocolManager.go b/protocols/protocolManager.go index 51e2105..a9b0566 100644 --- a/protocols/protocolManager.go +++ b/protocols/protocolManager.go @@ -1,13 +1,19 @@ package protocols -import "beelzebub/parser" +import ( + "beelzebub/parser" + "beelzebub/tracer" +) type ProtocolManager struct { strategy ServiceStrategy + tracer *tracer.Tracer } func (pm *ProtocolManager) InitServiceManager() *ProtocolManager { - return &ProtocolManager{} + return &ProtocolManager{ + tracer: tracer.Init(), + } } func (pm *ProtocolManager) SetProtocolStrategy(strategy ServiceStrategy) { @@ -15,5 +21,5 @@ func (pm *ProtocolManager) SetProtocolStrategy(strategy ServiceStrategy) { } func (pm *ProtocolManager) InitService(beelzebubServiceConfiguration parser.BeelzebubServiceConfiguration) error { - return pm.strategy.Init(beelzebubServiceConfiguration) + return pm.strategy.Init(beelzebubServiceConfiguration, *pm.tracer) }