Convert config from maps to lists for ordering

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Ian Gulliver
2026-01-24 16:00:26 -08:00
parent 997868949a
commit a6ce2e4696
3 changed files with 65 additions and 62 deletions

View File

@@ -8,12 +8,13 @@ import (
)
type Config struct {
Locations map[string]*Location `yaml:"locations" json:"locations"`
Locations []*Location `yaml:"locations" json:"locations"`
}
type Location struct {
Nodes []string `yaml:"nodes,omitempty" json:"nodes,omitempty"`
Children map[string]*Location `yaml:"children,omitempty" json:"children,omitempty"`
Name string `yaml:"name" json:"name"`
Nodes []string `yaml:"nodes,omitempty" json:"nodes,omitempty"`
Children []*Location `yaml:"children,omitempty" json:"children,omitempty"`
}
func LoadConfig(path string) (*Config, error) {