Extract cores.Server into new commonlisteners package

Functionality is the same.
Server has been renamed to CommonListenerS.
This commit is contained in:
ionutboangiu
2024-11-04 17:25:15 +02:00
committed by Dan Christian Bogos
parent 40c5d65af6
commit 5bf8f1756c
85 changed files with 229 additions and 224 deletions

View File

@@ -26,6 +26,7 @@ import (
"sync"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
@@ -60,7 +61,7 @@ func RunCGREngine(fs []string) (err error) {
return
}
cps := engine.NewCaps(cfg.CoreSCfg().Caps, cfg.CoreSCfg().CapsStrategy)
server := cores.NewServer(cps)
server := commonlisteners.NewServer(cps)
cgr := services.NewCGREngine(cfg, engine.NewConnManager(cfg), new(sync.WaitGroup), server, cps)
defer cgr.Stop(*flags.PidFile)

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package cores
package commonlisteners
import (
"encoding/base64"

View File

@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package cores
package commonlisteners
import (
"encoding/base64"

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package cores
package commonlisteners
import (
"net"

View File

@@ -15,7 +15,7 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package cores
package commonlisteners
import (
"net"

View File

@@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package cores
package commonlisteners
import (
"bytes"
@@ -48,7 +48,7 @@ import (
)
var (
server *Server
server *CommonListenerS
sTestsServer = []func(t *testing.T){
testServeJSON,

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package cores
package commonlisteners
import (
"crypto/tls"
@@ -39,8 +39,8 @@ import (
"golang.org/x/net/websocket"
)
func NewServer(caps *engine.Caps) (s *Server) {
s = &Server{
func NewServer(caps *engine.Caps) (s *CommonListenerS) {
s = &CommonListenerS{
httpMux: http.NewServeMux(),
httpsMux: http.NewServeMux(),
stopbiRPCServer: make(chan struct{}, 1),
@@ -54,7 +54,7 @@ func NewServer(caps *engine.Caps) (s *Server) {
return
}
type Server struct {
type CommonListenerS struct {
sync.RWMutex
httpEnabled bool
birpcSrv *birpc.BirpcServer
@@ -74,23 +74,23 @@ type Server struct {
startSrv sync.Once
}
func (s *Server) SetAnalyzer(anz *analyzers.AnalyzerS) {
func (s *CommonListenerS) SetAnalyzer(anz *analyzers.AnalyzerS) {
s.anz = anz
}
func (s *Server) RpcRegister(rcvr any) {
func (s *CommonListenerS) RpcRegister(rcvr any) {
s.rpcServer.Register(rcvr)
}
func (s *Server) RpcRegisterName(name string, rcvr any) {
func (s *CommonListenerS) RpcRegisterName(name string, rcvr any) {
s.rpcServer.RegisterName(name, rcvr)
}
func (s *Server) RpcUnregisterName(name string) {
func (s *CommonListenerS) RpcUnregisterName(name string) {
s.rpcServer.UnregisterName(name)
}
func (s *Server) RegisterHTTPFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) {
func (s *CommonListenerS) RegisterHTTPFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) {
s.httpMux.HandleFunc(pattern, handler)
s.httpsMux.HandleFunc(pattern, handler)
s.Lock()
@@ -98,7 +98,7 @@ func (s *Server) RegisterHTTPFunc(pattern string, handler func(http.ResponseWrit
s.Unlock()
}
func (s *Server) RegisterHttpHandler(pattern string, handler http.Handler) {
func (s *CommonListenerS) RegisterHttpHandler(pattern string, handler http.Handler) {
s.httpMux.Handle(pattern, handler)
s.httpsMux.Handle(pattern, handler)
s.Lock()
@@ -107,15 +107,15 @@ func (s *Server) RegisterHttpHandler(pattern string, handler http.Handler) {
}
// Registers a new BiJsonRpc name
func (s *Server) BiRPCRegisterName(name string, rcv any) {
func (s *CommonListenerS) BiRPCRegisterName(name string, rcv any) {
s.birpcSrv.RegisterName(name, rcv)
}
func (s *Server) BiRPCUnregisterName(name string) {
func (s *CommonListenerS) BiRPCUnregisterName(name string) {
s.birpcSrv.UnregisterName(name)
}
func (s *Server) handleRequest(w http.ResponseWriter, r *http.Request) {
func (s *CommonListenerS) handleRequest(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
rmtIP, _ := utils.GetRemoteIP(r)
rmtAddr, _ := net.ResolveIPAddr(utils.EmptyString, rmtIP)
@@ -124,11 +124,11 @@ func (s *Server) handleRequest(w http.ResponseWriter, r *http.Request) {
r.Body.Close()
}
func (s *Server) handleWebSocket(ws *websocket.Conn) {
func (s *CommonListenerS) handleWebSocket(ws *websocket.Conn) {
s.rpcServer.ServeCodec(newCapsJSONCodec(ws, s.caps, s.anz))
}
func (s *Server) ServeJSON(ctx *context.Context, shtdwnEngine context.CancelFunc, addr string) (err error) {
func (s *CommonListenerS) ServeJSON(ctx *context.Context, shtdwnEngine context.CancelFunc, addr string) (err error) {
if s.rpcJSONl, err = net.Listen(utils.TCP, addr); err != nil {
log.Printf("Serve%s listen error: %s", utils.JSONCaps, err)
shtdwnEngine()
@@ -140,7 +140,7 @@ func (s *Server) ServeJSON(ctx *context.Context, shtdwnEngine context.CancelFunc
})
}
func (s *Server) ServeGOB(ctx *context.Context, shtdwnEngine context.CancelFunc, addr string) (err error) {
func (s *CommonListenerS) ServeGOB(ctx *context.Context, shtdwnEngine context.CancelFunc, addr string) (err error) {
if s.rpcGOBl, err = net.Listen(utils.TCP, addr); err != nil {
log.Printf("Serve%s listen error: %s", utils.GOBCaps, err)
shtdwnEngine()
@@ -152,7 +152,7 @@ func (s *Server) ServeGOB(ctx *context.Context, shtdwnEngine context.CancelFunc,
})
}
func (s *Server) ServeHTTP(shtdwnEngine context.CancelFunc,
func (s *CommonListenerS) ServeHTTP(shtdwnEngine context.CancelFunc,
addr, jsonRPCURL, wsRPCURL, promURL, pprofPath string,
useBasicAuth bool, userList map[string]string) {
s.Lock()
@@ -219,7 +219,7 @@ func (s *Server) ServeHTTP(shtdwnEngine context.CancelFunc,
}
// ServeBiRPC create a goroutine to listen and serve as BiRPC server
func (s *Server) ServeBiRPC(addrJSON, addrGOB string, onConn, onDis func(birpc.ClientConnector)) (err error) {
func (s *CommonListenerS) ServeBiRPC(addrJSON, addrGOB string, onConn, onDis func(birpc.ClientConnector)) (err error) {
s.birpcSrv.OnConnect(onConn)
s.birpcSrv.OnDisconnect(onDis)
if addrJSON != utils.EmptyString {
@@ -244,7 +244,7 @@ func (s *Server) ServeBiRPC(addrJSON, addrGOB string, onConn, onDis func(birpc.C
return
}
func (s *Server) ServeGOBTLS(ctx *context.Context, shtdwnEngine context.CancelFunc,
func (s *CommonListenerS) ServeGOBTLS(ctx *context.Context, shtdwnEngine context.CancelFunc,
addr, serverCrt, serverKey, caCert string, serverPolicy int, serverName string) (err error) {
config, err := loadTLSConfig(serverCrt, serverKey, caCert, serverPolicy, serverName)
if err != nil {
@@ -264,7 +264,7 @@ func (s *Server) ServeGOBTLS(ctx *context.Context, shtdwnEngine context.CancelFu
})
}
func (s *Server) ServeJSONTLS(ctx *context.Context, shtdwnEngine context.CancelFunc,
func (s *CommonListenerS) ServeJSONTLS(ctx *context.Context, shtdwnEngine context.CancelFunc,
addr, serverCrt, serverKey, caCert string, serverPolicy int, serverName string) (err error) {
config, err := loadTLSConfig(serverCrt, serverKey, caCert, serverPolicy, serverName)
if err != nil {
@@ -284,7 +284,7 @@ func (s *Server) ServeJSONTLS(ctx *context.Context, shtdwnEngine context.CancelF
})
}
func (s *Server) ServeHTTPS(shtdwnEngine context.CancelFunc,
func (s *CommonListenerS) ServeHTTPS(shtdwnEngine context.CancelFunc,
addr, serverCrt, serverKey, caCert string, serverPolicy int,
serverName, jsonRPCURL, wsRPCURL, pprofPath string,
useBasicAuth bool, userList map[string]string) {
@@ -349,7 +349,7 @@ func (s *Server) ServeHTTPS(shtdwnEngine context.CancelFunc,
}
}
func (s *Server) Stop() {
func (s *CommonListenerS) Stop() {
if s.rpcJSONl != nil {
s.rpcJSONl.Close()
}
@@ -372,12 +372,12 @@ func (s *Server) Stop() {
}
// StopBiRPC stops the go routine create with ServeBiJSON
func (s *Server) StopBiRPC() {
func (s *CommonListenerS) StopBiRPC() {
s.stopbiRPCServer <- struct{}{}
s.birpcSrv = birpc.NewBirpcServer()
}
func (s *Server) StartServer(ctx *context.Context, shtdwnEngine context.CancelFunc, cfg *config.CGRConfig) {
func (s *CommonListenerS) StartServer(ctx *context.Context, shtdwnEngine context.CancelFunc, cfg *config.CGRConfig) {
s.startSrv.Do(func() {
go s.ServeJSON(ctx, shtdwnEngine, cfg.ListenCfg().RPCJSONListen)
go s.ServeGOB(ctx, shtdwnEngine, cfg.ListenCfg().RPCGOBListen)

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package cores
package commonlisteners
import (
"io"
@@ -37,7 +37,7 @@ func TestNewServer(t *testing.T) {
cfgDflt.CoreSCfg().CapsStatsInterval = 1
caps := engine.NewCaps(0, utils.MetaBusy)
expected := &Server{
expected := &CommonListenerS{
httpMux: http.NewServeMux(),
httpsMux: http.NewServeMux(),
caps: caps,

View File

@@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package cores
package commonlisteners
import (
"bytes"

View File

@@ -26,9 +26,9 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/accounts"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -37,7 +37,7 @@ import (
// NewAccountService returns the Account Service
func NewAccountService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager, server *cores.Server,
connMgr *engine.ConnManager, server *commonlisteners.CommonListenerS,
internalChan chan birpc.ClientConnector,
anz *AnalyzerService, srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &AccountService{
@@ -62,7 +62,7 @@ type AccountService struct {
cacheS *CacheService
filterSChan chan *engine.FilterS
connMgr *engine.ConnManager
server *cores.Server
server *commonlisteners.CommonListenerS
rldChan chan struct{}
stopChan chan struct{}

View File

@@ -28,8 +28,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -47,7 +47,7 @@ func TestAccountSReload(t *testing.T) {
chSCh := make(chan *engine.CacheS, 1)
chSCh <- chS
css := &CacheService{cacheCh: chSCh}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -25,9 +25,9 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/accounts"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -37,7 +37,7 @@ func TestAccountSCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
actRPC := make(chan birpc.ClientConnector, 1)

View File

@@ -26,9 +26,9 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/actions"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -38,7 +38,7 @@ import (
func NewActionService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager,
server *cores.Server, internalChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalChan chan birpc.ClientConnector,
anz *AnalyzerService, srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &ActionService{
connChan: internalChan,
@@ -62,7 +62,7 @@ type ActionService struct {
cacheS *CacheService
filterSChan chan *engine.FilterS
connMgr *engine.ConnManager
server *cores.Server
server *commonlisteners.CommonListenerS
rldChan chan struct{}
stopChan chan struct{}

View File

@@ -28,8 +28,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -47,7 +47,7 @@ func TestActionSReload(t *testing.T) {
chSCh := make(chan *engine.CacheS, 1)
chSCh <- chS
css := &CacheService{cacheCh: chSCh}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -25,8 +25,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/actions"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -36,7 +36,7 @@ func TestActionSCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
actRPC := make(chan birpc.ClientConnector, 1)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/apis"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -34,7 +34,7 @@ import (
// NewAPIerSv1Service returns the APIerSv1 Service
func NewAdminSv1Service(cfg *config.CGRConfig,
dm *DataDBService, storDB *StorDBService,
filterSChan chan *engine.FilterS, server *cores.Server,
filterSChan chan *engine.FilterS, server *commonlisteners.CommonListenerS,
internalAPIerSv1Chan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
@@ -58,7 +58,7 @@ type AdminSv1Service struct {
dm *DataDBService
storDB *StorDBService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
api *apis.AdminSv1

View File

@@ -25,14 +25,14 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/analyzers"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
// NewAnalyzerService returns the Analyzer Service
func NewAnalyzerService(cfg *config.CGRConfig, server *cores.Server,
func NewAnalyzerService(cfg *config.CGRConfig, server *commonlisteners.CommonListenerS,
filterSChan chan *engine.FilterS,
internalAnalyzerSChan chan birpc.ClientConnector,
srvDep map[string]*sync.WaitGroup) *AnalyzerService {
@@ -49,7 +49,7 @@ func NewAnalyzerService(cfg *config.CGRConfig, server *cores.Server,
type AnalyzerService struct {
sync.RWMutex
cfg *config.CGRConfig
server *cores.Server
server *commonlisteners.CommonListenerS
filterSChan chan *engine.FilterS
ctx *context.Context
cancelFunc context.CancelFunc

View File

@@ -30,8 +30,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -46,7 +46,7 @@ func TestAnalyzerSReload(t *testing.T) {
shdWg := new(sync.WaitGroup)
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
@@ -109,7 +109,7 @@ func TestAnalyzerSReload2(t *testing.T) {
}
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anzRPC := make(chan birpc.ClientConnector, 1)
anz := NewAnalyzerService(cfg, server, filterSChan, anzRPC, srvDep)
@@ -136,7 +136,7 @@ func TestAnalyzerSReload3(t *testing.T) {
cfg.AnalyzerSCfg().IndexType = ""
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anzRPC := make(chan birpc.ClientConnector, 1)
anz := NewAnalyzerService(cfg, server, filterSChan, anzRPC, srvDep)

View File

@@ -24,9 +24,9 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/analyzers"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -36,7 +36,7 @@ func TestAnalyzerCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
connChan := make(chan birpc.ClientConnector, 1)
anz := NewAnalyzerService(cfg, server, filterSChan, connChan, srvDep)

View File

@@ -28,8 +28,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -48,7 +48,7 @@ func TestAsteriskAgentReload(t *testing.T) {
}()
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
@@ -106,7 +106,7 @@ func TestAsteriskAgentReload2(t *testing.T) {
}()
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -25,8 +25,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/apis"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -35,7 +35,7 @@ import (
// NewAttributeService returns the Attribute Service
func NewAttributeService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
server *cores.Server, internalChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalChan chan birpc.ClientConnector,
anz *AnalyzerService, dspS *DispatcherService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &AttributeService{
@@ -58,7 +58,7 @@ type AttributeService struct {
dm *DataDBService
cacheS *CacheService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
attrS *engine.AttributeS
rpc *apis.AttributeSv1 // useful on restart

View File

@@ -28,8 +28,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -47,7 +47,7 @@ func TestAttributeSReload(t *testing.T) {
chSCh := make(chan *engine.CacheS, 1)
chSCh <- chS
css := &CacheService{cacheCh: chSCh}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -35,7 +35,7 @@ func TestAttributeSCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
attrRPC := make(chan birpc.ClientConnector, 1)
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -23,6 +23,7 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
@@ -31,7 +32,7 @@ import (
// NewCacheService .
func NewCacheService(cfg *config.CGRConfig, dm *DataDBService, connMgr *engine.ConnManager,
server *cores.Server, internalChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalChan chan birpc.ClientConnector,
anz *AnalyzerService, // dspS *DispatcherService,
cores *CoreService,
srvDep map[string]*sync.WaitGroup) *CacheService {
@@ -53,7 +54,7 @@ type CacheService struct {
cfg *config.CGRConfig
anz *AnalyzerService
cores *CoreService
server *cores.Server
server *commonlisteners.CommonListenerS
dm *DataDBService
connMgr *engine.ConnManager
rpc chan birpc.ClientConnector

View File

@@ -26,8 +26,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/cdrs"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -36,7 +36,7 @@ import (
// NewCDRServer returns the CDR Server
func NewCDRServer(cfg *config.CGRConfig, dm *DataDBService,
storDB *StorDBService, filterSChan chan *engine.FilterS,
server *cores.Server, internalCDRServerChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalCDRServerChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &CDRService{
@@ -60,7 +60,7 @@ type CDRService struct {
storDB *StorDBService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
cdrS *cdrs.CDRServer
connChan chan birpc.ClientConnector

View File

@@ -28,8 +28,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -50,7 +50,7 @@ func TestCdrsReload(t *testing.T) {
css := &CacheService{cacheCh: chSCh}
cfg.ChargerSCfg().Enabled = true
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -23,8 +23,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/cdrs"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -35,7 +35,7 @@ func TestCdrsCoverage(t *testing.T) {
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
cfg.ChargerSCfg().Enabled = true
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -29,6 +29,7 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/efs"
@@ -40,7 +41,7 @@ import (
)
func NewCGREngine(cfg *config.CGRConfig, cM *engine.ConnManager, shdWg *sync.WaitGroup,
server *cores.Server, caps *engine.Caps) *CGREngine {
server *commonlisteners.CommonListenerS, caps *engine.Caps) *CGREngine {
return &CGREngine{
cfg: cfg, // Engine configuration
cM: cM, // connection manager
@@ -95,7 +96,7 @@ type CGREngine struct {
srvDep map[string]*sync.WaitGroup
shdWg *sync.WaitGroup
cM *engine.ConnManager
server *cores.Server
server *commonlisteners.CommonListenerS
caps *engine.Caps
cpuPrfF *os.File

View File

@@ -25,8 +25,8 @@ import (
"github.com/cgrates/birpc/context"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -34,7 +34,7 @@ import (
// NewChargerService returns the Charger Service
func NewChargerService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS, server *cores.Server,
cacheS *CacheService, filterSChan chan *engine.FilterS, server *commonlisteners.CommonListenerS,
internalChargerSChan chan birpc.ClientConnector, connMgr *engine.ConnManager,
anz *AnalyzerService, srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &ChargerService{
@@ -57,7 +57,7 @@ type ChargerService struct {
dm *DataDBService
cacheS *CacheService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
chrS *engine.ChargerS

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -52,7 +52,7 @@ func TestChargerSReload(t *testing.T) {
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
db := NewDataDBService(cfg, nil, false, srvDep)
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -37,7 +37,7 @@ func TestChargerSCoverage(t *testing.T) {
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
db := NewDataDBService(cfg, nil, false, srvDep)
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
chS := NewCacheService(cfg, db, nil, server, make(chan context.ClientConnector, 1), anz, nil, srvDep)

View File

@@ -25,6 +25,7 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
@@ -32,7 +33,7 @@ import (
)
// NewCoreService returns the Core Service
func NewCoreService(cfg *config.CGRConfig, caps *engine.Caps, server *cores.Server,
func NewCoreService(cfg *config.CGRConfig, caps *engine.Caps, server *commonlisteners.CommonListenerS,
internalCoreSChan chan birpc.ClientConnector, anz *AnalyzerService,
fileCPU *os.File, shdWg *sync.WaitGroup,
srvDep map[string]*sync.WaitGroup) *CoreService {
@@ -53,7 +54,7 @@ func NewCoreService(cfg *config.CGRConfig, caps *engine.Caps, server *cores.Serv
type CoreService struct {
mu sync.RWMutex
cfg *config.CGRConfig
server *cores.Server
server *commonlisteners.CommonListenerS
caps *engine.Caps
stopChan chan struct{}
shdWg *sync.WaitGroup

View File

@@ -28,8 +28,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -41,7 +41,7 @@ func TestCoreSReload(t *testing.T) {
shdWg := new(sync.WaitGroup)
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -23,6 +23,7 @@ import (
"testing"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
@@ -33,7 +34,7 @@ import (
func TestCoreSCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
caps := engine.NewCaps(1, "test_caps")
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
internalCoreSChan := make(chan birpc.ClientConnector, 1)
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -48,7 +48,7 @@ func TestDataDBReload(t *testing.T) {
chSCh := make(chan *engine.CacheS, 1)
chSCh <- chS
css := &CacheService{cacheCh: chSCh}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
cM := engine.NewConnManager(cfg)

View File

@@ -28,8 +28,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -42,7 +42,7 @@ func TestDiameterAgentReload1(t *testing.T) {
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -23,8 +23,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/dispatchers"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
@@ -33,7 +33,7 @@ import (
// NewDispatcherService returns the Dispatcher Service
func NewDispatcherService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
server *cores.Server, internalChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) *DispatcherService {
return &DispatcherService{
@@ -57,7 +57,7 @@ type DispatcherService struct {
dm *DataDBService
cacheS *CacheService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
dspS *dispatchers.DispatcherService

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -52,7 +52,7 @@ func TestDispatcherSReload(t *testing.T) {
css := &CacheService{cacheCh: chSCh}
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -23,10 +23,10 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/dispatchers"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -37,7 +37,7 @@ func TestDispatcherSCoverage(t *testing.T) {
cfg.AttributeSCfg().Enabled = true
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -30,8 +30,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/agents"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -66,7 +66,7 @@ func TestDNSAgentStartReloadShut(t *testing.T) {
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
engine.NewConnManager(cfg)
db := NewDataDBService(cfg, nil, false, srvDep)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
sS := NewSessionService(cfg, db, filterSChan, server, make(chan birpc.ClientConnector, 1),
nil, anz, srvDep)
@@ -109,7 +109,7 @@ func TestDNSAgentReloadFirst(t *testing.T) {
}()
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/ees"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
@@ -34,7 +34,7 @@ import (
// NewEventExporterService constructs EventExporterService
func NewEventExporterService(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager, server *cores.Server, intConnChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, server *commonlisteners.CommonListenerS, intConnChan chan birpc.ClientConnector,
anz *AnalyzerService, srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &EventExporterService{
cfg: cfg,
@@ -54,7 +54,7 @@ type EventExporterService struct {
cfg *config.CGRConfig
filterSChan chan *engine.FilterS
connMgr *engine.ConnManager
server *cores.Server
server *commonlisteners.CommonListenerS
intConnChan chan birpc.ClientConnector
eeS *ees.EeS

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -52,7 +52,7 @@ func TestEventExporterSReload(t *testing.T) {
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
@@ -130,7 +130,7 @@ func TestEventExporterSReload2(t *testing.T) {
cfg.AttributeSCfg().Enabled = true
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
ees := NewEventExporterService(cfg, filterSChan, engine.NewConnManager(cfg),

View File

@@ -22,10 +22,10 @@ import (
"testing"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/ees"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -37,7 +37,7 @@ func TestEventExporterSCoverage(t *testing.T) {
cfg.AttributeSCfg().Enabled = true
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
srv := NewEventExporterService(cfg, filterSChan, engine.NewConnManager(cfg), server, make(chan birpc.ClientConnector, 1), anz, srvDep)

View File

@@ -25,8 +25,8 @@ import (
"github.com/cgrates/birpc/context"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/efs"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
@@ -38,7 +38,7 @@ type ExportFailoverService struct {
cfg *config.CGRConfig
connMgr *engine.ConnManager
server *cores.Server
server *commonlisteners.CommonListenerS
srv *birpc.Service
intConnChan chan birpc.ClientConnector
stopChan chan struct{}
@@ -50,7 +50,7 @@ type ExportFailoverService struct {
// NewExportFailoverService is the constructor for the TpeService
func NewExportFailoverService(cfg *config.CGRConfig, connMgr *engine.ConnManager,
intConnChan chan birpc.ClientConnector,
server *cores.Server, srvDep map[string]*sync.WaitGroup) *ExportFailoverService {
server *commonlisteners.CommonListenerS, srvDep map[string]*sync.WaitGroup) *ExportFailoverService {
return &ExportFailoverService{
cfg: cfg,
server: server,

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/ers"
"github.com/cgrates/cgrates/servmanager"
@@ -37,7 +37,7 @@ func NewEventReaderService(
cfg *config.CGRConfig,
filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager,
server *cores.Server,
server *commonlisteners.CommonListenerS,
intConn chan birpc.ClientConnector,
anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
@@ -63,7 +63,7 @@ type EventReaderService struct {
rldChan chan struct{}
stopChan chan struct{}
connMgr *engine.ConnManager
server *cores.Server
server *commonlisteners.CommonListenerS
intConn chan birpc.ClientConnector
anz *AnalyzerService
srvDep map[string]*sync.WaitGroup

View File

@@ -30,8 +30,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/ers"
"github.com/cgrates/cgrates/servmanager"
@@ -59,7 +59,7 @@ func TestEventReaderSReload(t *testing.T) {
time.Sleep(10 * time.Millisecond)
}()
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
@@ -128,7 +128,7 @@ func TestEventReaderSReload2(t *testing.T) {
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
erS := NewEventReaderService(cfg, filterSChan, nil, server, nil, nil, srvDep)
ers := ers.NewERService(cfg, nil, nil)

View File

@@ -22,7 +22,7 @@ import (
"sync"
"testing"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/ers"
"github.com/cgrates/cgrates/config"
@@ -37,7 +37,7 @@ func TestEventReaderSCoverage(t *testing.T) {
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srv := NewEventReaderService(cfg, filterSChan, nil, server, nil, nil, srvDep)
if srv.IsRunning() {

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/agents"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -50,7 +50,7 @@ func TestFreeSwitchAgentReload(t *testing.T) {
}()
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/agents"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -33,7 +33,7 @@ import (
// NewHTTPAgent returns the HTTP Agent
func NewHTTPAgent(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
server *cores.Server, connMgr *engine.ConnManager,
server *commonlisteners.CommonListenerS, connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &HTTPAgent{
cfg: cfg,
@@ -49,7 +49,7 @@ type HTTPAgent struct {
sync.RWMutex
cfg *config.CGRConfig
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
// we can realy stop the HTTPAgent so keep a flag
// if we registerd the handlers

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -48,7 +48,7 @@ func TestHTTPAgentReload(t *testing.T) {
time.Sleep(10 * time.Millisecond)
}()
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -22,8 +22,8 @@ import (
"sync"
"testing"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -31,7 +31,7 @@ import (
// TestHTTPAgent for cover testing
func TestHTTPAgentCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}

View File

@@ -25,8 +25,8 @@ import (
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/agents"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -34,7 +34,7 @@ import (
// NewJanusAgent returns the Janus Agent
func NewJanusAgent(cfg *config.CGRConfig, filterSChan chan *engine.FilterS,
server *cores.Server, connMgr *engine.ConnManager,
server *commonlisteners.CommonListenerS, connMgr *engine.ConnManager,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &JanusAgent{
cfg: cfg,
@@ -50,7 +50,7 @@ type JanusAgent struct {
sync.RWMutex
cfg *config.CGRConfig
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
jA *agents.JanusAgent
// we can realy stop the JanusAgent so keep a flag

View File

@@ -30,9 +30,9 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/agents"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -47,7 +47,7 @@ func TestKamailioAgentReload(t *testing.T) {
filterSChan <- nil
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -32,8 +32,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/apis"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/guardian"
"github.com/cgrates/cgrates/loaders"
@@ -185,7 +185,7 @@ func cgrStartFilterService(ctx *context.Context, iFilterSCh chan *engine.FilterS
}
func cgrInitGuardianSv1(iGuardianSCh chan birpc.ClientConnector, cfg *config.CGRConfig,
server *cores.Server, anz *AnalyzerService) {
server *commonlisteners.CommonListenerS, anz *AnalyzerService) {
srv, _ := engine.NewServiceWithName(guardian.Guardian, utils.GuardianS, true)
if !cfg.DispatcherSCfg().Enabled {
for _, s := range srv {
@@ -197,7 +197,7 @@ func cgrInitGuardianSv1(iGuardianSCh chan birpc.ClientConnector, cfg *config.CGR
func cgrInitServiceManagerV1(iServMngrCh chan birpc.ClientConnector,
srvMngr *servmanager.ServiceManager, cfg *config.CGRConfig,
server *cores.Server, anz *AnalyzerService) {
server *commonlisteners.CommonListenerS, anz *AnalyzerService) {
srv, _ := birpc.NewService(apis.NewServiceManagerV1(srvMngr), utils.EmptyString, false)
if !cfg.DispatcherSCfg().Enabled {
server.RpcRegister(srv)
@@ -206,7 +206,7 @@ func cgrInitServiceManagerV1(iServMngrCh chan birpc.ClientConnector,
}
func cgrInitConfigSv1(iConfigCh chan birpc.ClientConnector,
cfg *config.CGRConfig, server *cores.Server, anz *AnalyzerService) {
cfg *config.CGRConfig, server *commonlisteners.CommonListenerS, anz *AnalyzerService) {
srv, _ := engine.NewServiceWithName(cfg, utils.ConfigS, true)
// srv, _ := birpc.NewService(apis.NewConfigSv1(cfg), "", false)
if !cfg.DispatcherSCfg().Enabled {
@@ -218,7 +218,7 @@ func cgrInitConfigSv1(iConfigCh chan birpc.ClientConnector,
}
func cgrStartRPC(ctx *context.Context, shtdwnEngine context.CancelFunc,
cfg *config.CGRConfig, server *cores.Server, internalDispatcherSChan chan birpc.ClientConnector) {
cfg *config.CGRConfig, server *commonlisteners.CommonListenerS, internalDispatcherSChan chan birpc.ClientConnector) {
if cfg.DispatcherSCfg().Enabled { // wait only for dispatcher as cache is allways registered before this
select {
case dispatcherS := <-internalDispatcherSChan:

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc/context"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/loaders"
"github.com/cgrates/cgrates/utils"
@@ -33,7 +33,7 @@ import (
// NewLoaderService returns the Loader Service
func NewLoaderService(cfg *config.CGRConfig, dm *DataDBService,
filterSChan chan *engine.FilterS, server *cores.Server,
filterSChan chan *engine.FilterS, server *commonlisteners.CommonListenerS,
internalLoaderSChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) *LoaderService {
@@ -56,7 +56,7 @@ type LoaderService struct {
cfg *config.CGRConfig
dm *DataDBService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
stopChan chan struct{}
ldrs *loaders.LoaderS

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -70,7 +70,7 @@ func TestLoaderSReload(t *testing.T) {
shdWg := new(sync.WaitGroup)
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
@@ -150,7 +150,7 @@ func TestLoaderSReload2(t *testing.T) {
}
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
db.dbchan <- new(engine.DataManager)
@@ -175,7 +175,7 @@ func TestLoaderSReload3(t *testing.T) {
cfg.LoaderCfg()[0].RunDelay = -1
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
db.dbchan <- new(engine.DataManager)

View File

@@ -23,8 +23,8 @@ import (
"testing"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/loaders"
"github.com/cgrates/cgrates/utils"
@@ -35,7 +35,7 @@ func TestLoaderSCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
internalLoaderSChan := make(chan birpc.ClientConnector, 1)

View File

@@ -30,8 +30,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/agents"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -51,7 +51,7 @@ func TestRadiusAgentReload(t *testing.T) {
}()
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
@@ -111,7 +111,7 @@ func TestRadiusAgentReload2(t *testing.T) {
}()
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -25,8 +25,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -35,7 +35,7 @@ import (
// NewRankingService returns the RankingS Service
func NewRankingService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
server *cores.Server, internalRankingSChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalRankingSChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &RankingService{
@@ -57,7 +57,7 @@ type RankingService struct {
dm *DataDBService
cacheS *CacheService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
connChan chan birpc.ClientConnector
anz *AnalyzerService

View File

@@ -23,8 +23,8 @@ import (
"testing"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -35,7 +35,7 @@ func TestNewRankingService(t *testing.T) {
cacheS := &CacheService{}
filterSChan := make(chan *engine.FilterS)
birpc := make(chan birpc.ClientConnector)
server := &cores.Server{}
server := &commonlisteners.CommonListenerS{}
connMgr := &engine.ConnManager{}
anz := &AnalyzerService{}
srvDep := make(map[string]*sync.WaitGroup)

View File

@@ -23,8 +23,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/rates"
"github.com/cgrates/cgrates/servmanager"
@@ -34,7 +34,7 @@ import (
// NewRateService constructs RateService
func NewRateService(cfg *config.CGRConfig,
cacheS *CacheService, filterSChan chan *engine.FilterS,
dmS *DataDBService, server *cores.Server,
dmS *DataDBService, server *commonlisteners.CommonListenerS,
intConnChan chan birpc.ClientConnector, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &RateService{
@@ -58,7 +58,7 @@ type RateService struct {
filterSChan chan *engine.FilterS
dmS *DataDBService
cacheS *CacheService
server *cores.Server
server *commonlisteners.CommonListenerS
rldChan chan struct{}
stopChan chan struct{}

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -42,7 +42,7 @@ func TestRateSReload(t *testing.T) {
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -24,10 +24,10 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/rates"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -37,7 +37,7 @@ func TestRateSCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -22,8 +22,8 @@ import (
"sync"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/registrarc"
"github.com/cgrates/cgrates/servmanager"
@@ -31,7 +31,7 @@ import (
)
// NewRegistrarCService returns the Dispatcher Service
func NewRegistrarCService(cfg *config.CGRConfig, server *cores.Server,
func NewRegistrarCService(cfg *config.CGRConfig, server *commonlisteners.CommonListenerS,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &RegistrarCService{
@@ -47,7 +47,7 @@ func NewRegistrarCService(cfg *config.CGRConfig, server *cores.Server,
type RegistrarCService struct {
sync.RWMutex
cfg *config.CGRConfig
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
stopChan chan struct{}
rldChan chan struct{}

View File

@@ -30,8 +30,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -50,7 +50,7 @@ func TestDispatcherHReload(t *testing.T) {
shdWg := new(sync.WaitGroup)
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -23,8 +23,8 @@ import (
"testing"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/registrarc"
"github.com/cgrates/cgrates/utils"
@@ -35,7 +35,7 @@ func TestDispatcherHCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
cM := engine.NewConnManager(cfg)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -34,7 +34,7 @@ import (
// NewResourceService returns the Resource Service
func NewResourceService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
server *cores.Server, internalResourceSChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalResourceSChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &ResourceService{
@@ -57,7 +57,7 @@ type ResourceService struct {
dm *DataDBService
cacheS *CacheService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
reS *engine.ResourceS
connChan chan birpc.ClientConnector

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -54,7 +54,7 @@ func TestResourceSReload(t *testing.T) {
chSCh := make(chan *engine.CacheS, 1)
chSCh <- chS
css := &CacheService{cacheCh: chSCh}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -36,7 +36,7 @@ func TestResourceSCoverage(t *testing.T) {
cfg.ThresholdSCfg().Enabled = true
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -25,8 +25,8 @@ import (
"github.com/cgrates/birpc/context"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -35,7 +35,7 @@ import (
// NewRouteService returns the Route Service
func NewRouteService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
server *cores.Server, internalRouteSChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalRouteSChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &RouteService{
@@ -58,7 +58,7 @@ type RouteService struct {
dm *DataDBService
cacheS *CacheService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
routeS *engine.RouteS

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -49,7 +49,7 @@ func TestRouteSReload(t *testing.T) {
chSCh := make(chan *engine.CacheS, 1)
chSCh <- chS
css := &CacheService{cacheCh: chSCh}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -36,7 +36,7 @@ func TestSupplierSCoverage(t *testing.T) {
cfg.StatSCfg().Enabled = true
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -25,7 +25,7 @@ import (
"github.com/cgrates/birpc/context"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/config"
@@ -36,7 +36,7 @@ import (
// NewSessionService returns the Session Service
func NewSessionService(cfg *config.CGRConfig, dm *DataDBService, filterSChan chan *engine.FilterS,
server *cores.Server, internalChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &SessionService{
@@ -57,7 +57,7 @@ type SessionService struct {
cfg *config.CGRConfig
dm *DataDBService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
stopChan chan struct{}
sm *sessions.SessionS

View File

@@ -30,8 +30,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/sessions"
"github.com/cgrates/cgrates/utils"
@@ -63,7 +63,7 @@ func TestSessionSReload1(t *testing.T) {
engine.Cache = engine.NewCacheS(cfg, nil, nil, nil)
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
clientConect := make(chan birpc.ClientConnector, 1)
@@ -153,7 +153,7 @@ func TestSessionSReload2(t *testing.T) {
internalChan := make(chan birpc.ClientConnector, 1)
internalChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
@@ -199,7 +199,7 @@ func TestSessionSReload3(t *testing.T) {
internalChan := make(chan birpc.ClientConnector, 1)
internalChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -24,10 +24,10 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/sessions"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -47,7 +47,7 @@ func TestSessionSCoverage(t *testing.T) {
cfg.CdrsCfg().Enabled = true
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -45,7 +45,7 @@ func TestSIPAgentReload(t *testing.T) {
filterSChan <- nil
shdWg := new(sync.WaitGroup)
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -34,7 +34,7 @@ import (
// NewStatService returns the Stat Service
func NewStatService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
server *cores.Server, internalStatSChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalStatSChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &StatService{
@@ -57,7 +57,7 @@ type StatService struct {
dm *DataDBService
cacheS *CacheService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
sts *engine.StatS

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -54,7 +54,7 @@ func TestStatSReload(t *testing.T) {
chSCh := make(chan *engine.CacheS, 1)
chSCh <- chS
css := &CacheService{cacheCh: chSCh}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -37,7 +37,7 @@ func TestStatSCoverage(t *testing.T) {
cfg.ThresholdSCfg().Enabled = true
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -35,7 +35,7 @@ import (
func NewThresholdService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
connMgr *engine.ConnManager,
server *cores.Server, internalThresholdSChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalThresholdSChan chan birpc.ClientConnector,
anz *AnalyzerService, srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &ThresholdService{
connChan: internalThresholdSChan,
@@ -57,7 +57,7 @@ type ThresholdService struct {
dm *DataDBService
cacheS *CacheService
filterSChan chan *engine.FilterS
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
thrs *engine.ThresholdS

View File

@@ -29,8 +29,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -50,7 +50,7 @@ func TestThresholdSReload(t *testing.T) {
chSCh := make(chan *engine.CacheS, 1)
chSCh <- chS
css := &CacheService{cacheCh: chSCh}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
@@ -119,7 +119,7 @@ func TestThresholdSReload2(t *testing.T) {
chSCh := make(chan *engine.CacheS, 1)
chSCh <- chS
css := &CacheService{cacheCh: chSCh}
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvMngr := servmanager.NewServiceManager(shdWg, nil, cfg)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -35,7 +35,7 @@ func TestThresholdSCoverage(t *testing.T) {
cfg := config.NewDefaultCGRConfig()
filterSChan := make(chan *engine.FilterS, 1)
filterSChan <- nil
server := cores.NewServer(nil)
server := commonlisteners.NewServer(nil)
srvDep := map[string]*sync.WaitGroup{utils.DataDB: new(sync.WaitGroup)}
anz := NewAnalyzerService(cfg, server, filterSChan, make(chan birpc.ClientConnector, 1), srvDep)
db := NewDataDBService(cfg, nil, false, srvDep)

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/apis"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/tpes"
@@ -34,7 +34,7 @@ import (
// NewTPeService is the constructor for the TpeService
func NewTPeService(cfg *config.CGRConfig, connMgr *engine.ConnManager, dm *DataDBService,
server *cores.Server, srvDep map[string]*sync.WaitGroup) servmanager.Service {
server *commonlisteners.CommonListenerS, srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &TPeService{
cfg: cfg,
srvDep: srvDep,
@@ -49,7 +49,7 @@ type TPeService struct {
sync.RWMutex
cfg *config.CGRConfig
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
tpes *tpes.TPeS
dm *DataDBService

View File

@@ -24,8 +24,8 @@ import (
"github.com/cgrates/birpc"
"github.com/cgrates/birpc/context"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/servmanager"
"github.com/cgrates/cgrates/utils"
@@ -34,7 +34,7 @@ import (
// NewTrendsService returns the TrendS Service
func NewTrendService(cfg *config.CGRConfig, dm *DataDBService,
cacheS *CacheService, filterSChan chan *engine.FilterS,
server *cores.Server, internalTrendSChan chan birpc.ClientConnector,
server *commonlisteners.CommonListenerS, internalTrendSChan chan birpc.ClientConnector,
connMgr *engine.ConnManager, anz *AnalyzerService,
srvDep map[string]*sync.WaitGroup) servmanager.Service {
return &TrendService{
@@ -54,7 +54,7 @@ type TrendService struct {
cfg *config.CGRConfig
dm *DataDBService
cacheS *CacheService
server *cores.Server
server *commonlisteners.CommonListenerS
connMgr *engine.ConnManager
filterSChan chan *engine.FilterS
connChan chan birpc.ClientConnector

View File

@@ -23,8 +23,8 @@ import (
"testing"
"github.com/cgrates/birpc"
"github.com/cgrates/cgrates/commonlisteners"
"github.com/cgrates/cgrates/config"
"github.com/cgrates/cgrates/cores"
"github.com/cgrates/cgrates/engine"
"github.com/cgrates/cgrates/utils"
)
@@ -34,7 +34,7 @@ func TestNewTrendService(t *testing.T) {
dm := &DataDBService{}
cacheS := &CacheService{}
filterSChan := make(chan *engine.FilterS)
server := &cores.Server{}
server := &commonlisteners.CommonListenerS{}
internalTrendSChan := make(chan birpc.ClientConnector)
connMgr := &engine.ConnManager{}
anz := &AnalyzerService{}