config add "Group" notion

a group contains an ordered list of settings sections and/or other
groups. Intended to be rendered as an accordion tree in the app. Has no
effect on INI structure.
This commit is contained in:
Harvey Tindall
2025-11-24 15:16:47 +00:00
parent 704157be00
commit 6bfb345169
2 changed files with 37 additions and 0 deletions

View File

@@ -48,8 +48,22 @@ type Section struct {
Settings []Setting `json:"settings" yaml:"settings"`
}
// Member is a member of a group, and can either reference a Section or another Group, hence the two fields.
type Member struct {
Group string `json:"group,omitempty", yaml:"group,omitempty"`
Section string `json:"section,omitempty", yaml:"section,omitempty"`
}
type Group struct {
Group string `json:"group" yaml:"group" example:"messaging_providers"`
Name string `json:"name" yaml:"name" example:"Messaging Providers"`
Description string `json:"description" yaml:"description" example:"Options for setting up messaging providers."`
Members []Member `json:"members" yaml:"members"`
}
type Config struct {
Sections []Section `json:"sections" yaml:"sections"`
Groups []Group `json:"groups" yaml:"groups"`
}
func (c *Config) removeSection(section string) {