Remove srvDep from services that don't use it

This commit is contained in:
ionutboangiu
2024-12-05 18:17:51 +02:00
committed by Dan Christian Bogos
parent e51eed46e7
commit 0783984bfe
32 changed files with 40 additions and 132 deletions

View File

@@ -140,43 +140,43 @@ func runCGREngine(fs []string) (err error) {
// ServiceIndexer will share service references to all services
srvIdxr := servmanager.NewServiceIndexer()
gvS := services.NewGlobalVarS(cfg, srvDep, srvIdxr)
gvS := services.NewGlobalVarS(cfg, srvIdxr)
dmS := services.NewDataDBService(cfg, connMgr, *flags.SetVersions, srvDep, srvIdxr)
sdbS := services.NewStorDBService(cfg, *flags.SetVersions, srvDep, srvIdxr)
cls := services.NewCommonListenerService(cfg, caps, clsCh, srvDep, srvIdxr)
anzS := services.NewAnalyzerService(cfg, clsCh, iFilterSCh, anzCh, srvDep, srvIdxr)
coreS := services.NewCoreService(cfg, caps, clsCh, anzCh, cpuPrfF, shdWg, srvDep, srvIdxr)
cacheS := services.NewCacheService(cfg, dmS, connMgr, clsCh, anzCh, coreS, srvDep, srvIdxr)
dspS := services.NewDispatcherService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
ldrs := services.NewLoaderService(cfg, dmS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
efs := services.NewExportFailoverService(cfg, connMgr, clsCh, srvDep, srvIdxr)
adminS := services.NewAdminSv1Service(cfg, dmS, sdbS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
sessionS := services.NewSessionService(cfg, dmS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
attrS := services.NewAttributeService(cfg, dmS, cacheS, iFilterSCh, clsCh, anzCh, dspS, srvDep, srvIdxr)
chrgS := services.NewChargerService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
routeS := services.NewRouteService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
sdbS := services.NewStorDBService(cfg, *flags.SetVersions, srvIdxr)
cls := services.NewCommonListenerService(cfg, caps, clsCh, srvIdxr)
anzS := services.NewAnalyzerService(cfg, clsCh, iFilterSCh, anzCh, srvIdxr)
coreS := services.NewCoreService(cfg, caps, clsCh, anzCh, cpuPrfF, shdWg, srvIdxr)
cacheS := services.NewCacheService(cfg, dmS, connMgr, clsCh, anzCh, coreS, srvIdxr)
dspS := services.NewDispatcherService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvIdxr)
ldrs := services.NewLoaderService(cfg, dmS, iFilterSCh, clsCh, connMgr, anzCh, srvIdxr)
efs := services.NewExportFailoverService(cfg, connMgr, clsCh, srvIdxr)
adminS := services.NewAdminSv1Service(cfg, dmS, sdbS, iFilterSCh, clsCh, connMgr, anzCh, srvIdxr)
sessionS := services.NewSessionService(cfg, dmS, iFilterSCh, clsCh, connMgr, anzCh, srvIdxr)
attrS := services.NewAttributeService(cfg, dmS, cacheS, iFilterSCh, clsCh, anzCh, dspS, srvIdxr)
chrgS := services.NewChargerService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvIdxr)
routeS := services.NewRouteService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvIdxr)
resourceS := services.NewResourceService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
trendS := services.NewTrendService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
rankingS := services.NewRankingService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
thS := services.NewThresholdService(cfg, dmS, cacheS, iFilterSCh, connMgr, clsCh, anzCh, srvDep, srvIdxr)
stS := services.NewStatService(cfg, dmS, cacheS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
erS := services.NewEventReaderService(cfg, iFilterSCh, connMgr, clsCh, anzCh, srvDep, srvIdxr)
dnsAgent := services.NewDNSAgent(cfg, iFilterSCh, connMgr, srvDep, srvIdxr)
fsAgent := services.NewFreeswitchAgent(cfg, connMgr, srvDep, srvIdxr)
kamAgent := services.NewKamailioAgent(cfg, connMgr, srvDep, srvIdxr)
janusAgent := services.NewJanusAgent(cfg, iFilterSCh, clsCh, connMgr, srvDep, srvIdxr)
astAgent := services.NewAsteriskAgent(cfg, connMgr, srvDep, srvIdxr)
radAgent := services.NewRadiusAgent(cfg, iFilterSCh, connMgr, srvDep, srvIdxr)
diamAgent := services.NewDiameterAgent(cfg, iFilterSCh, connMgr, caps, srvDep, srvIdxr)
httpAgent := services.NewHTTPAgent(cfg, iFilterSCh, clsCh, connMgr, srvDep, srvIdxr)
sipAgent := services.NewSIPAgent(cfg, iFilterSCh, connMgr, srvDep, srvIdxr)
eeS := services.NewEventExporterService(cfg, iFilterSCh, connMgr, clsCh, anzCh, srvDep, srvIdxr)
cdrS := services.NewCDRServer(cfg, dmS, sdbS, iFilterSCh, clsCh, connMgr, anzCh, srvDep, srvIdxr)
registrarcS := services.NewRegistrarCService(cfg, connMgr, srvDep, srvIdxr)
rateS := services.NewRateService(cfg, cacheS, iFilterSCh, dmS, clsCh, anzCh, srvDep, srvIdxr)
actionS := services.NewActionService(cfg, dmS, cacheS, iFilterSCh, connMgr, clsCh, anzCh, srvDep, srvIdxr)
accS := services.NewAccountService(cfg, dmS, cacheS, iFilterSCh, connMgr, clsCh, anzCh, srvDep, srvIdxr)
tpeS := services.NewTPeService(cfg, connMgr, dmS, clsCh, srvDep, srvIdxr)
erS := services.NewEventReaderService(cfg, iFilterSCh, connMgr, clsCh, anzCh, srvIdxr)
dnsAgent := services.NewDNSAgent(cfg, iFilterSCh, connMgr, srvIdxr)
fsAgent := services.NewFreeswitchAgent(cfg, connMgr, srvIdxr)
kamAgent := services.NewKamailioAgent(cfg, connMgr, srvIdxr)
janusAgent := services.NewJanusAgent(cfg, iFilterSCh, clsCh, connMgr, srvIdxr)
astAgent := services.NewAsteriskAgent(cfg, connMgr, srvIdxr)
radAgent := services.NewRadiusAgent(cfg, iFilterSCh, connMgr, srvIdxr)
diamAgent := services.NewDiameterAgent(cfg, iFilterSCh, connMgr, caps, srvIdxr)
httpAgent := services.NewHTTPAgent(cfg, iFilterSCh, clsCh, connMgr, srvIdxr)
sipAgent := services.NewSIPAgent(cfg, iFilterSCh, connMgr, srvIdxr)
eeS := services.NewEventExporterService(cfg, iFilterSCh, connMgr, clsCh, anzCh, srvIdxr)
cdrS := services.NewCDRServer(cfg, dmS, sdbS, iFilterSCh, clsCh, connMgr, anzCh, srvIdxr)
registrarcS := services.NewRegistrarCService(cfg, connMgr, srvIdxr)
rateS := services.NewRateService(cfg, cacheS, iFilterSCh, dmS, clsCh, anzCh, srvIdxr)
actionS := services.NewActionService(cfg, dmS, cacheS, iFilterSCh, connMgr, clsCh, anzCh, srvIdxr)
accS := services.NewAccountService(cfg, dmS, cacheS, iFilterSCh, connMgr, clsCh, anzCh, srvIdxr)
tpeS := services.NewTPeService(cfg, connMgr, dmS, clsCh, srvIdxr)
srvManager := servmanager.NewServiceManager(shdWg, connMgr, cfg, srvIdxr, []servmanager.Service{
gvS,

View File

@@ -38,7 +38,7 @@ import (
func NewAccountService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager, clSChan chan *commonlisteners.CommonListenerS,
anzChan chan *AnalyzerService, srvDep map[string]*sync.WaitGroup,
anzChan chan *AnalyzerService,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &AccountService{
cfg: cfg,
@@ -48,7 +48,6 @@ func NewAccountService(cfg *config.CGRConfig, dm *DataDBService,
connMgr: connMgr,
clSChan: clSChan,
anzChan: anzChan,
srvDep: srvDep,
rldChan: make(chan struct{}, 1),
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
@@ -72,7 +71,6 @@ type AccountService struct {
stopChan chan struct{}
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -39,7 +39,7 @@ func NewActionService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager,
clSChan chan *commonlisteners.CommonListenerS,
anzChan chan *AnalyzerService, srvDep map[string]*sync.WaitGroup,
anzChan chan *AnalyzerService,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &ActionService{
connMgr: connMgr,
@@ -49,7 +49,6 @@ func NewActionService(cfg *config.CGRConfig, dm *DataDBService,
filterSChan: filterSChan,
clSChan: clSChan,
anzChan: anzChan,
srvDep: srvDep,
rldChan: make(chan struct{}, 1),
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
@@ -74,7 +73,6 @@ type ActionService struct {
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // share the API object implementing API calls for internal
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -36,7 +36,6 @@ func NewAdminSv1Service(cfg *config.CGRConfig,
dm *DataDBService, storDB *StorDBService,
filterSChan chan *engine.FilterS, clSChan chan *commonlisteners.CommonListenerS,
connMgr *engine.ConnManager, anzChan chan *AnalyzerService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &AdminSv1Service{
cfg: cfg,
@@ -46,7 +45,6 @@ func NewAdminSv1Service(cfg *config.CGRConfig,
clSChan: clSChan,
connMgr: connMgr,
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -68,7 +66,6 @@ type AdminSv1Service struct {
stopChan chan struct{}
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // RPC connector with internal APIs
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -36,14 +36,12 @@ import (
func NewAnalyzerService(cfg *config.CGRConfig, clSChan chan *commonlisteners.CommonListenerS,
filterSChan chan *engine.FilterS,
anzChan chan *AnalyzerService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) *AnalyzerService {
return &AnalyzerService{
cfg: cfg,
clSChan: clSChan,
filterSChan: filterSChan,
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -62,7 +60,6 @@ type AnalyzerService struct {
cancelFunc context.CancelFunc
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // share the API object implementing API calls for internal
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -35,12 +35,10 @@ import (
// NewAsteriskAgent returns the Asterisk Agent
func NewAsteriskAgent(cfg *config.CGRConfig,
connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &AsteriskAgent{
cfg: cfg,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -54,7 +52,6 @@ type AsteriskAgent struct {
smas []*agents.AsteriskAgent
connMgr *engine.ConnManager
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // share the API object implementing API calls for internal
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -37,7 +37,7 @@ func NewAttributeService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
clSChan chan *commonlisteners.CommonListenerS,
anzChan chan *AnalyzerService, dspS *DispatcherService,
srvDep map[string]*sync.WaitGroup, sIndxr *servmanager.ServiceIndexer) servmanager.Service {
sIndxr *servmanager.ServiceIndexer) servmanager.Service {
return &AttributeService{
cfg: cfg,
dm: dm,
@@ -45,7 +45,6 @@ func NewAttributeService(cfg *config.CGRConfig, dm *DataDBService,
filterSChan: filterSChan,
clSChan: clSChan,
anzChan: anzChan,
srvDep: srvDep,
dspS: dspS,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
serviceIndexer: sIndxr,
@@ -67,8 +66,7 @@ type AttributeService struct {
cl *commonlisteners.CommonListenerS
rpc *apis.AttributeSv1 // useful on restart
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
cfg *config.CGRConfig
intRPCconn birpc.ClientConnector // expose API methods over internal connection
serviceIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -19,8 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package services
import (
"sync"
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
@@ -36,11 +34,9 @@ func NewCacheService(cfg *config.CGRConfig, dm *DataDBService, connMgr *engine.C
clSChan chan *commonlisteners.CommonListenerS,
anzChan chan *AnalyzerService, // dspS *DispatcherService,
cores *CoreService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) *CacheService {
return &CacheService{
cfg: cfg,
srvDep: srvDep,
anzChan: anzChan,
cores: cores,
clSChan: clSChan,
@@ -64,7 +60,6 @@ type CacheService struct {
cacheCh chan *engine.CacheS
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -38,7 +38,6 @@ func NewCDRServer(cfg *config.CGRConfig, dm *DataDBService,
storDB *StorDBService, filterSChan chan *engine.FilterS,
clSChan chan *commonlisteners.CommonListenerS,
connMgr *engine.ConnManager, anzChan chan *AnalyzerService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &CDRService{
cfg: cfg,
@@ -48,7 +47,6 @@ func NewCDRServer(cfg *config.CGRConfig, dm *DataDBService,
clSChan: clSChan,
connMgr: connMgr,
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -70,7 +68,6 @@ type CDRService struct {
stopChan chan struct{}
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -36,7 +36,7 @@ import (
func NewChargerService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS, clSChan chan *commonlisteners.CommonListenerS,
connMgr *engine.ConnManager,
anzChan chan *AnalyzerService, srvDep map[string]*sync.WaitGroup,
anzChan chan *AnalyzerService,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &ChargerService{
cfg: cfg,
@@ -46,7 +46,6 @@ func NewChargerService(cfg *config.CGRConfig, dm *DataDBService,
clSChan: clSChan,
connMgr: connMgr,
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -67,7 +66,6 @@ type ChargerService struct {
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -33,13 +33,12 @@ import (
// NewCommonListenerService instantiates a new CommonListenerService.
func NewCommonListenerService(cfg *config.CGRConfig, caps *engine.Caps,
clSChan chan *commonlisteners.CommonListenerS, srvDep map[string]*sync.WaitGroup,
clSChan chan *commonlisteners.CommonListenerS,
srvIndexer *servmanager.ServiceIndexer) *CommonListenerService {
return &CommonListenerService{
cfg: cfg,
caps: caps,
clSChan: clSChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -54,7 +53,6 @@ type CommonListenerService struct {
clSChan chan *commonlisteners.CommonListenerS
caps *engine.Caps
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -37,7 +37,6 @@ import (
func NewCoreService(cfg *config.CGRConfig, caps *engine.Caps, clSChan chan *commonlisteners.CommonListenerS,
anzChan chan *AnalyzerService,
fileCPU *os.File, shdWg *sync.WaitGroup,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) *CoreService {
return &CoreService{
shdWg: shdWg,
@@ -46,7 +45,6 @@ func NewCoreService(cfg *config.CGRConfig, caps *engine.Caps, clSChan chan *comm
fileCPU: fileCPU,
clSChan: clSChan,
anzChan: anzChan,
srvDep: srvDep,
csCh: make(chan *cores.CoreS, 1),
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
@@ -69,7 +67,6 @@ type CoreService struct {
stopChan chan struct{}
shdWg *sync.WaitGroup
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -34,14 +34,12 @@ import (
// NewDiameterAgent returns the Diameter Agent
func NewDiameterAgent(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager, caps *engine.Caps,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &DiameterAgent{
cfg: cfg,
filterSChan: filterSChan,
connMgr: connMgr,
caps: caps,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -61,8 +59,6 @@ type DiameterAgent struct {
lnet string
laddr string
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here
stateDeps *StateDependencies // channel subscriptions for state changes

View File

@@ -36,7 +36,6 @@ func NewDispatcherService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
clSChan chan *commonlisteners.CommonListenerS,
connMgr *engine.ConnManager, anzChan chan *AnalyzerService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) *DispatcherService {
return &DispatcherService{
cfg: cfg,
@@ -46,7 +45,6 @@ func NewDispatcherService(cfg *config.CGRConfig, dm *DataDBService,
clSChan: clSChan,
connMgr: connMgr,
anzChan: anzChan,
srvDep: srvDep,
srvsReload: make(map[string]chan struct{}),
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
@@ -69,7 +67,6 @@ type DispatcherService struct {
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvsReload map[string]chan struct{}
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -34,13 +34,11 @@ import (
// NewDNSAgent returns the DNS Agent
func NewDNSAgent(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &DNSAgent{
cfg: cfg,
filterSChan: filterSChan,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -56,7 +54,6 @@ type DNSAgent struct {
dns *agents.DNSAgent
connMgr *engine.ConnManager
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -35,7 +35,7 @@ import (
// NewEventExporterService constructs EventExporterService
func NewEventExporterService(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager, clSChan chan *commonlisteners.CommonListenerS,
anzChan chan *AnalyzerService, srvDep map[string]*sync.WaitGroup,
anzChan chan *AnalyzerService,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &EventExporterService{
cfg: cfg,
@@ -43,7 +43,6 @@ func NewEventExporterService(cfg *config.CGRConfig, filterSChan chan *engine.Fil
connMgr: connMgr,
clSChan: clSChan,
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -62,7 +61,6 @@ type EventExporterService struct {
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -46,7 +46,6 @@ type ExportFailoverService struct {
stopChan chan struct{}
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here
@@ -56,13 +55,11 @@ type ExportFailoverService struct {
// NewExportFailoverService is the constructor for the TpeService
func NewExportFailoverService(cfg *config.CGRConfig, connMgr *engine.ConnManager,
clSChan chan *commonlisteners.CommonListenerS,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) *ExportFailoverService {
return &ExportFailoverService{
cfg: cfg,
clSChan: clSChan,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}

View File

@@ -39,7 +39,6 @@ func NewEventReaderService(
connMgr *engine.ConnManager,
clSChan chan *commonlisteners.CommonListenerS,
anzChan chan *AnalyzerService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &EventReaderService{
rldChan: make(chan struct{}, 1),
@@ -48,7 +47,6 @@ func NewEventReaderService(
connMgr: connMgr,
clSChan: clSChan,
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -69,7 +67,6 @@ type EventReaderService struct {
stopChan chan struct{}
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -35,12 +35,10 @@ import (
// NewFreeswitchAgent returns the Freeswitch Agent
func NewFreeswitchAgent(cfg *config.CGRConfig,
connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &FreeswitchAgent{
cfg: cfg,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -53,7 +51,6 @@ type FreeswitchAgent struct {
fS *agents.FSsessions
connMgr *engine.ConnManager
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -19,8 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
package services
import (
"sync"
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/engine"
@@ -32,11 +30,9 @@ import (
// NewGlobalVarS .
func NewGlobalVarS(cfg *config.CGRConfig,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) *GlobalVarS {
return &GlobalVarS{
cfg: cfg,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -44,8 +40,7 @@ func NewGlobalVarS(cfg *config.CGRConfig,
// GlobalVarS implements Agent interface
type GlobalVarS struct {
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
cfg *config.CGRConfig
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -35,14 +35,12 @@ import (
// NewHTTPAgent returns the HTTP Agent
func NewHTTPAgent(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
clSChan chan *commonlisteners.CommonListenerS, connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &HTTPAgent{
cfg: cfg,
filterSChan: filterSChan,
clSChan: clSChan,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -63,7 +61,6 @@ type HTTPAgent struct {
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -36,14 +36,12 @@ import (
// NewJanusAgent returns the Janus Agent
func NewJanusAgent(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
clSChan chan *commonlisteners.CommonListenerS, connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &JanusAgent{
cfg: cfg,
filterSChan: filterSChan,
clSChan: clSChan,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -64,7 +62,6 @@ type JanusAgent struct {
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -36,12 +36,10 @@ import (
// NewKamailioAgent returns the Kamailio Agent
func NewKamailioAgent(cfg *config.CGRConfig,
connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &KamailioAgent{
cfg: cfg,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -54,7 +52,6 @@ type KamailioAgent struct {
kam *agents.KamailioAgent
connMgr *engine.ConnManager
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -36,7 +36,6 @@ import (
func NewLoaderService(cfg *config.CGRConfig, dm *DataDBService,
filterSChan chan *engine.FilterS, clSChan chan *commonlisteners.CommonListenerS,
connMgr *engine.ConnManager, anzChan chan *AnalyzerService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) *LoaderService {
return &LoaderService{
cfg: cfg,
@@ -46,7 +45,6 @@ func NewLoaderService(cfg *config.CGRConfig, dm *DataDBService,
connMgr: connMgr,
stopChan: make(chan struct{}),
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -67,7 +65,6 @@ type LoaderService struct {
stopChan chan struct{}
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -34,13 +34,11 @@ import (
// NewRadiusAgent returns the Radius Agent
func NewRadiusAgent(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &RadiusAgent{
cfg: cfg,
filterSChan: filterSChan,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -55,7 +53,6 @@ type RadiusAgent struct {
rad *agents.RadiusAgent
connMgr *engine.ConnManager
srvDep map[string]*sync.WaitGroup
lnet string
lauth string

View File

@@ -36,7 +36,6 @@ func NewRateService(cfg *config.CGRConfig,
cacheS *CacheService, filterSChan chan *engine.FilterS,
dmS *DataDBService, clSChan chan *commonlisteners.CommonListenerS,
anzChan chan *AnalyzerService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &RateService{
cfg: cfg,
@@ -46,7 +45,6 @@ func NewRateService(cfg *config.CGRConfig,
clSChan: clSChan,
rldChan: make(chan struct{}),
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -68,7 +66,6 @@ type RateService struct {
rldChan chan struct{}
stopChan chan struct{}
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -32,12 +32,10 @@ import (
// NewRegistrarCService returns the Dispatcher Service
func NewRegistrarCService(cfg *config.CGRConfig, connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &RegistrarCService{
cfg: cfg,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -53,7 +51,6 @@ type RegistrarCService struct {
rldChan chan struct{}
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -37,7 +37,6 @@ func NewRouteService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
clSChan chan *commonlisteners.CommonListenerS,
connMgr *engine.ConnManager, anzChan chan *AnalyzerService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &RouteService{
cfg: cfg,
@@ -47,7 +46,6 @@ func NewRouteService(cfg *config.CGRConfig, dm *DataDBService,
clSChan: clSChan,
connMgr: connMgr,
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -68,7 +66,6 @@ type RouteService struct {
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -38,7 +38,6 @@ import (
func NewSessionService(cfg *config.CGRConfig, dm *DataDBService, filterSChan chan *engine.FilterS,
clSChan chan *commonlisteners.CommonListenerS,
connMgr *engine.ConnManager, anzChan chan *AnalyzerService,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &SessionService{
cfg: cfg,
@@ -47,7 +46,6 @@ func NewSessionService(cfg *config.CGRConfig, dm *DataDBService, filterSChan cha
clSChan: clSChan,
connMgr: connMgr,
anzChan: anzChan,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -69,7 +67,6 @@ type SessionService struct {
stopChan chan struct{}
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here

View File

@@ -34,13 +34,11 @@ import (
// NewSIPAgent returns the sip Agent
func NewSIPAgent(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &SIPAgent{
cfg: cfg,
filterSChan: filterSChan,
connMgr: connMgr,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -54,7 +52,6 @@ type SIPAgent struct {
sip *agents.SIPAgent
connMgr *engine.ConnManager
srvDep map[string]*sync.WaitGroup
oldListen string

View File

@@ -32,12 +32,10 @@ import (
// NewStorDBService returns the StorDB Service
func NewStorDBService(cfg *config.CGRConfig, setVersions bool,
srvDep map[string]*sync.WaitGroup,
srvIndexer *servmanager.ServiceIndexer) *StorDBService {
return &StorDBService{
cfg: cfg,
setVersions: setVersions,
srvDep: srvDep,
srvIndexer: srvIndexer,
stateDeps: NewStateDependencies([]string{utils.StateServiceUP}),
}
@@ -53,8 +51,6 @@ type StorDBService struct {
syncChans []chan engine.StorDB
setVersions bool
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here
stateDeps *StateDependencies // channel subscriptions for state changes

View File

@@ -34,11 +34,10 @@ import (
// NewTPeService is the constructor for the TpeService
func NewTPeService(cfg *config.CGRConfig, connMgr *engine.ConnManager, dm *DataDBService,
clSChan chan *commonlisteners.CommonListenerS, srvDep map[string]*sync.WaitGroup,
clSChan chan *commonlisteners.CommonListenerS,
srvIndexer *servmanager.ServiceIndexer) servmanager.Service {
return &TPeService{
cfg: cfg,
srvDep: srvDep,
dm: dm,
connMgr: connMgr,
clSChan: clSChan,
@@ -61,7 +60,6 @@ type TPeService struct {
stopChan chan struct{}
connMgr *engine.ConnManager
cfg *config.CGRConfig
srvDep map[string]*sync.WaitGroup
intRPCconn birpc.ClientConnector // expose API methods over internal connection
srvIndexer *servmanager.ServiceIndexer // access directly services from here