Documentation
¶
Overview ¶
Package system holds the system settings row (the system table), one stored value per setting, and the parsing of the node settings kept in it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseNodeConfig ¶ added in v1.21.0
func ParseNodeConfig(rows []*System) (config.NodeConfig, error)
ParseNodeConfig decodes the node configuration stored in the "server" settings rows. Startup, the admin reload and the admin settings read all parse it here, so they agree on every rule.
DNS and Outbound hold JSON documents; a malformed one is reported rather than dropped. A scalar setting that does not decode keeps its zero value and Block is decoded leniently, as they always have been; both are logged with the setting's key.
Types ¶
type System ¶
type System struct {
Id int64 `gorm:"primarykey"`
Category string `gorm:"type:varchar(100);default:'';not null;comment:Category"`
Key string `gorm:"index:index_key;unique;type:varchar(100);default:'';not null;comment:Key Name"`
Value string `gorm:"type:text;not null;comment:Key Value"`
Type string `gorm:"type:varchar(50);default:'';not null;comment:Type"`
Desc string `gorm:"type:text;not null;comment:Description"`
CreatedAt time.Time `gorm:"<-:create;comment:Creation Time"`
UpdatedAt time.Time `gorm:"comment:Update Time"`
}
func (*System) ConfigKey ¶
ConfigKey, ConfigValue, and ConfigType expose the system configuration record through the narrow contract used by generic configuration helpers.