feat: apply configuration on start

This commit is contained in:
2025-05-17 22:28:56 +02:00
parent d8e047d58b
commit 9e6fcbdd74
11 changed files with 156 additions and 19 deletions

View File

@@ -7,8 +7,10 @@ import (
)
type Config struct {
Rcond RcondConfig `yaml:"rcond"`
Cluster ClusterConfig `yaml:"cluster"`
Hostname string `yaml:"hostname"`
Rcond RcondConfig `yaml:"rcond"`
Network NetworkConfig `yaml:"network"`
Cluster ClusterConfig `yaml:"cluster"`
}
type RcondConfig struct {
@@ -16,6 +18,25 @@ type RcondConfig struct {
ApiToken string `yaml:"api_token"`
}
type NetworkConfig struct {
Connections []ConnectionConfig `yaml:"connections"`
}
type ConnectionConfig struct {
Type string `yaml:"type,omitempty"`
UUID string `yaml:"uuid,omitempty"`
ID string `yaml:"id,omitempty"`
AutoConnect bool `yaml:"autoconnect,omitempty"`
SSID string `yaml:"ssid,omitempty"`
Mode string `yaml:"mode,omitempty"`
Band string `yaml:"band,omitempty"`
Channel uint32 `yaml:"channel,omitempty"`
KeyMgmt string `yaml:"keymgmt,omitempty"`
PSK string `yaml:"psk,omitempty"`
IPv4Method string `yaml:"ipv4method,omitempty"`
IPv6Method string `yaml:"ipv6method,omitempty"`
}
type ClusterConfig struct {
Enabled bool `yaml:"enabled"`
NodeName string `yaml:"node_name"`