types: Add Setting.Category to group the settings
It's only used as an indicator the grouping. You don't need to know the category
to get the setting. The category each setting belonged to may change in the
future releases as well.
@@ -20,9 +20,18 @@ const (
SettingNameDefaultEngineImage = SettingName("default-engine-image")
)
+type SettingCategory string
+
+const (
+ SettingCategoryGeneral = SettingCategory("general")
+ SettingCategoryBackup = SettingCategory("backup")
+ SettingCategoryScheduling = SettingCategory("scheduling")
+)
+
type SettingDefinition struct {
DisplayName string `json:"displayName"`
Description string `json:"description"`
+ Category SettingCategory `json:"category"`
Type SettingType `json:"type"`
Required bool `json:"required"`
ReadOnly bool `json:"readOnly"`
@@ -39,6 +48,7 @@ var (
SettingDefinitionBackupTarget = SettingDefinition{
DisplayName: "Backup Target",
Description: "The target used for backup. Support NFS or S3.",
+ Category: SettingCategoryBackup,
Type: SettingTypeString,
Required: false,
ReadOnly: false,
@@ -47,6 +57,7 @@ var (
SettingDefinitionBackupTargetCredentialSecret = SettingDefinition{
DisplayName: "Backup Target Credential Secret",
Description: "The Kubernetes secret associated with the backup target.",
+ Category: SettingCategoryBackup,
Type: SettingTypeString,
Required: false,
ReadOnly: false,
@@ -55,6 +66,7 @@ var (
SettingDefinitionDefaultEngineImage = SettingDefinition{
DisplayName: "Default Engine Image",
Description: "The default engine image used by the manager. Can be changed on the manager starting command line only",
+ Category: SettingCategoryGeneral,
Type: SettingTypeString,
Required: true,
ReadOnly: true,
