refactor: simplify HA backend peer handling
- parsePeer: use net.SplitHostPort (handles IPv6, stdlib convention) - tryConnect: take Go strings, own CGO allocation internally - RegisterToBackend: remove unreachable 'no HA candidates' error path - Sync Peers field comment between utils and backend config structs
This commit is contained in:
parent
99d13f5254
commit
da6d967a33
3 changed files with 26 additions and 36 deletions
|
|
@ -18,10 +18,10 @@ type BackendConfig struct {
|
|||
From string `yaml:"from"`
|
||||
Key string `yaml:"key"`
|
||||
// Peers lists additional controller candidates for HA mode in "host:port"
|
||||
// format. When non-empty, RegisterToBackend iterates all candidates and
|
||||
// connects to whichever responds as primary. Address+Port remain the
|
||||
// single-host fallback when Peers is empty.
|
||||
Peers []string `yaml:"peers"`
|
||||
// format. When non-empty, RegisterToBackend tries each candidate in order
|
||||
// and connects to whichever accepts the join as primary. Address+Port
|
||||
// serve as a single-host fallback when Peers is empty.
|
||||
Peers []string `yaml:"peers"`
|
||||
}
|
||||
|
||||
type AppServerConfig struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue