feat: introduce cluster agent

This commit is contained in:
2025-05-13 21:59:44 +02:00
parent ee0489dcbb
commit 49014c951f
12 changed files with 485 additions and 18 deletions

View File

@@ -7,7 +7,8 @@ import (
)
type Config struct {
Rcond RcondConfig `yaml:"rcond"`
Rcond RcondConfig `yaml:"rcond"`
Cluster ClusterConfig `yaml:"cluster"`
}
type RcondConfig struct {
@@ -15,6 +16,17 @@ type RcondConfig struct {
ApiToken string `yaml:"api_token"`
}
type ClusterConfig struct {
Enabled bool `yaml:"enabled"`
NodeName string `yaml:"node_name"`
SecretKey string `yaml:"secret_key"`
Join []string `yaml:"join"`
AdvertiseAddr string `yaml:"advertise_addr"`
AdvertisePort int `yaml:"advertise_port"`
BindAddr string `yaml:"bind_addr"`
BindPort int `yaml:"bind_port"`
}
func LoadConfig(path string) (*Config, error) {
yamlFile, err := os.ReadFile(path)
if err != nil {