mysql
This commit is contained in:
@ -14,10 +14,12 @@ type Config struct {
|
|||||||
General struct {
|
General struct {
|
||||||
DeleteLogFileAtStart bool `yaml:"delete_log_file_at_start"`
|
DeleteLogFileAtStart bool `yaml:"delete_log_file_at_start"`
|
||||||
LogToFile bool `yaml:"log_to_file"`
|
LogToFile bool `yaml:"log_to_file"`
|
||||||
|
Callsign string `yaml:"callsign"`
|
||||||
LogLevel string `yaml:"log_level"`
|
LogLevel string `yaml:"log_level"`
|
||||||
TelnetServer bool `yaml:"telnetserver"`
|
TelnetServer bool `yaml:"telnetserver"`
|
||||||
FlexRadioSpot bool `yaml:"flexradiospot"`
|
FlexRadioSpot bool `yaml:"flexradiospot"`
|
||||||
} `yaml:"general"`
|
} `yaml:"general"`
|
||||||
|
|
||||||
Database struct {
|
Database struct {
|
||||||
MySQL bool `yaml:"mysql"`
|
MySQL bool `yaml:"mysql"`
|
||||||
SQLite bool `yaml:"sqlite"`
|
SQLite bool `yaml:"sqlite"`
|
||||||
@ -27,9 +29,9 @@ type Config struct {
|
|||||||
MySQLHost string `yaml:"mysql_host"`
|
MySQLHost string `yaml:"mysql_host"`
|
||||||
MySQLPort string `yaml:"mysql_port"`
|
MySQLPort string `yaml:"mysql_port"`
|
||||||
} `yaml:"database"`
|
} `yaml:"database"`
|
||||||
|
|
||||||
SQLite struct {
|
SQLite struct {
|
||||||
SQLitePath string `yaml:"sqlite_path"`
|
SQLitePath string `yaml:"sqlite_path"`
|
||||||
Callsign string `yaml:"callsign"`
|
|
||||||
} `yaml:"sqlite"`
|
} `yaml:"sqlite"`
|
||||||
|
|
||||||
Cluster struct {
|
Cluster struct {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
general:
|
general:
|
||||||
delete_log_file_at_start: true
|
delete_log_file_at_start: true
|
||||||
|
callsign: F4BPO # Log4OM Callsign used to check if you get spotted by someone
|
||||||
log_to_file: true
|
log_to_file: true
|
||||||
log_level: DEBUG # INFO or DEBUG or WARN
|
log_level: DEBUG # INFO or DEBUG or WARN
|
||||||
telnetserver: true # not in use for now
|
telnetserver: true # not in use for now
|
||||||
@ -14,7 +15,6 @@ database:
|
|||||||
mysql_port: 3306
|
mysql_port: 3306
|
||||||
sqlite:
|
sqlite:
|
||||||
sqlite_path: 'C:\Perso\Seafile\Radio\Logs\Log4OM\F4BPO.SQLite' # SQLite Db oath of Log4OM
|
sqlite_path: 'C:\Perso\Seafile\Radio\Logs\Log4OM\F4BPO.SQLite' # SQLite Db oath of Log4OM
|
||||||
callsign: F4BPO # Log4OM Callsign used to check if you get spotted by someone
|
|
||||||
cluster:
|
cluster:
|
||||||
server: cluster.f4bpo.com # dxc.k0xm.net dxc.sm7iun.se
|
server: cluster.f4bpo.com # dxc.k0xm.net dxc.sm7iun.se
|
||||||
port: 7300
|
port: 7300
|
||||||
|
@ -177,7 +177,7 @@ func (fc *FlexClient) SendSpottoFlex(spot TelnetSpot) {
|
|||||||
flexSpot.Priority = "1"
|
flexSpot.Priority = "1"
|
||||||
flexSpot.BackgroundColor = "#ff000000"
|
flexSpot.BackgroundColor = "#ff000000"
|
||||||
flexSpot.Comment = flexSpot.Comment + " [New DXCC]"
|
flexSpot.Comment = flexSpot.Comment + " [New DXCC]"
|
||||||
} else if spot.DX == Cfg.SQLite.Callsign {
|
} else if spot.DX == Cfg.General.Callsign {
|
||||||
flexSpot.Color = "#ffff0000"
|
flexSpot.Color = "#ffff0000"
|
||||||
flexSpot.Priority = "1"
|
flexSpot.Priority = "1"
|
||||||
flexSpot.BackgroundColor = "#ff000000"
|
flexSpot.BackgroundColor = "#ff000000"
|
||||||
@ -286,10 +286,10 @@ func (fc *FlexClient) ReadLine() {
|
|||||||
Log.Errorf("could not find spot by flex spot number in database: %s", err)
|
Log.Errorf("could not find spot by flex spot number in database: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
msg := fmt.Sprintf(`To ALL de %s <%s> : Clicked on "%s" at %s`, Cfg.SQLite.Callsign, spot.UTCTime, spot.DX, spot.FrequencyHz)
|
msg := fmt.Sprintf(`To ALL de %s <%s> : Clicked on "%s" at %s`, Cfg.General.Callsign, spot.UTCTime, spot.DX, spot.FrequencyHz)
|
||||||
if len(fc.TCPServer.Clients) > 0 {
|
if len(fc.TCPServer.Clients) > 0 {
|
||||||
fc.MsgChan <- msg
|
fc.MsgChan <- msg
|
||||||
Log.Infof("%s clicked on spot \"%s\" at %s", Cfg.SQLite.Callsign, spot.DX, spot.FrequencyMhz)
|
Log.Infof("%s clicked on spot \"%s\" at %s", Cfg.General.Callsign, spot.DX, spot.FrequencyMhz)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
main.go
2
main.go
@ -43,7 +43,7 @@ func main() {
|
|||||||
|
|
||||||
log := NewLog()
|
log := NewLog()
|
||||||
log.Info("Running FlexDXCluster version 0.6")
|
log.Info("Running FlexDXCluster version 0.6")
|
||||||
log.Infof("Callsign: %s", cfg.SQLite.Callsign)
|
log.Infof("Callsign: %s", cfg.General.Callsign)
|
||||||
|
|
||||||
DeleteDatabase("./flex.sqlite", log)
|
DeleteDatabase("./flex.sqlite", log)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user