mirror of
https://github.com/hrfee/jfa-go.git
synced 2026-01-18 16:47:42 +01:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user