This commit is contained in:
2025-10-15 00:28:53 +05:30
parent 5b46ac98ad
commit af52fe8c72
12 changed files with 433 additions and 290 deletions

View File

@@ -15,7 +15,7 @@ import (
log "github.com/sirupsen/logrus"
)
var spotRe *regexp.Regexp = regexp.MustCompile(`DX\sde\s([\w\d]+).*:\s+(\d+.\d)\s+([\w\d\/]+)\s+(CW|SSB|FT8|FT4|RTTY|USB|LSB)?\s+(.*)\s\s\s+([\d]+\w{1})`)
var spotRe *regexp.Regexp = regexp.MustCompile(`DX\sde\s([\w\d]+).*:\s+(\d+.\d)\s+([\w\d\/]+)\s+(CW|cw|SSB|ssb|FT8|ft8|FT4|ft4|RTTY|rtty|USB|usb|LSB|lsb)?\s+(.*)\s\s\s+([\d]+\w{1})`)
var defaultLoginRe *regexp.Regexp = regexp.MustCompile("[\\w\\d-_]+ login:")
var defaultPasswordRe *regexp.Regexp = regexp.MustCompile("Password:")
@@ -51,7 +51,7 @@ type TCPClient struct {
maxReconnectDelay time.Duration
}
func NewTCPClient(TCPServer *TCPServer, Countries Countries, contactRepo *Log4OMContactsRepository) *TCPClient {
func NewTCPClient(TCPServer *TCPServer, Countries Countries, contactRepo *Log4OMContactsRepository, spotChanToHTTPServer chan TelnetSpot) *TCPClient {
ctx, cancel := context.WithCancel(context.Background())
return &TCPClient{
@@ -61,9 +61,9 @@ func NewTCPClient(TCPServer *TCPServer, Countries Countries, contactRepo *Log4OM
Password: Cfg.Cluster.Password,
MsgChan: TCPServer.MsgChan,
CmdChan: TCPServer.CmdChan,
SpotChanToHTTPServer: spotChanToHTTPServer,
SpotChanToFlex: make(chan TelnetSpot, 100),
TCPServer: *TCPServer,
SpotChanToHTTPServer: make(chan TelnetSpot, 100),
Countries: Countries,
ContactRepo: contactRepo,
ctx: ctx,