Help us shape the future of Go! Take the 2026 Go Developer Survey

system

package
v1.21.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

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

func (s *System) ConfigKey() string

ConfigKey, ConfigValue, and ConfigType expose the system configuration record through the narrow contract used by generic configuration helpers.

func (*System) ConfigType

func (s *System) ConfigType() string

func (*System) ConfigValue

func (s *System) ConfigValue() string

func (System) TableName

func (System) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL