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"`
|
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 {
|
type Config struct {
|
||||||
Sections []Section `json:"sections" yaml:"sections"`
|
Sections []Section `json:"sections" yaml:"sections"`
|
||||||
|
Groups []Group `json:"groups" yaml:"groups"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config) removeSection(section string) {
|
func (c *Config) removeSection(section string) {
|
||||||
|
|||||||
@@ -1,3 +1,26 @@
|
|||||||
|
groups:
|
||||||
|
- group: external_services
|
||||||
|
name: "Integrations"
|
||||||
|
description: "Integrations with external services."
|
||||||
|
members:
|
||||||
|
- group: email
|
||||||
|
- group: chatbots
|
||||||
|
- section: ombi
|
||||||
|
- section: jellyseerr
|
||||||
|
- group: email
|
||||||
|
name: "Email"
|
||||||
|
description: "Options for sending emails through jfa-go."
|
||||||
|
members:
|
||||||
|
- section: email
|
||||||
|
- section: smtp
|
||||||
|
- section: mailgun
|
||||||
|
- group: chatbots
|
||||||
|
name: "Chat bots"
|
||||||
|
description: "Options for messaging through chat services."
|
||||||
|
members:
|
||||||
|
- section: discord
|
||||||
|
- section: telegram
|
||||||
|
- section: matrix
|
||||||
sections:
|
sections:
|
||||||
- section: updates
|
- section: updates
|
||||||
meta:
|
meta:
|
||||||
|
|||||||
Reference in New Issue
Block a user