This commit is contained in:
2024-10-24 01:16:25 +07:00
parent 40a6b71865
commit 6bef3f45cd
5 changed files with 84 additions and 80 deletions

12
main.go

@ -67,15 +67,17 @@ func main() {
defer cRepo.db.Close()
TCPServer := NewTCPServer(cfg.TelnetServer.Host, cfg.TelnetServer.Port, log)
FlexClient := NewFlexClient(*fRepo, TCPServer)
TCPClient := NewTCPClient(TCPServer, FlexClient, log, Countries)
HTTPServer := NewHTTPServer(*cRepo, *fRepo, FlexClient, TCPServer, log)
TCPClient := NewTCPClient(TCPServer, log, Countries)
FlexClient := NewFlexClient(*fRepo, TCPServer, TCPClient.SpotChanToFlex)
HTTPServer := NewHTTPServer(*cRepo, *fRepo, TCPServer, TCPClient.SpotChanToHTTPServer, log)
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, syscall.SIGHUP, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGTERM)
go FlexClient.StartFlexClient()
if Cfg.General.FlexRadioSpot {
go FlexClient.StartFlexClient()
}
go TCPClient.StartClient()
go TCPServer.StartServer()