Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAppConfig = &AppConfig{ System: SysConfig{ Appid: "TeamsACS", Location: "Asia/Shanghai", Workdir: "/var/teamsacs", Debug: true, }, Web: WebConfig{ Host: "0.0.0.0", Port: 2979, TlsPort: 2989, Secret: "9b6de5cc-0001-1203-1100-0f568ac7da37", }, Database: DBConfig{ Type: "postgres", Host: "127.0.0.1", Port: 5432, Name: "teamsacs_v1", User: "postgres", Passwd: "myroot", MaxConn: 100, IdleConn: 10, Debug: false, }, Tr069: Tr069Config{ Host: "0.0.0.0", Tls: true, Port: 2999, Secret: "9b6de5cc-1q21-1203-xxtt-0f568ac9d237", Debug: true, }, Mqtt: MqttConfig{ Server: "", Username: "", Password: "", Debug: false, }, }
Functions ¶
This section is empty.
Types ¶
type AppConfig ¶
type AppConfig struct { System SysConfig `yaml:"system" json:"system"` Web WebConfig `yaml:"web" json:"web"` Database DBConfig `yaml:"database" json:"database"` Tr069 Tr069Config `yaml:"tr069" json:"tr069"` Mqtt MqttConfig `yaml:"mqtt" json:"mqtt"` }
func LoadConfig ¶
func (*AppConfig) GetBackupDir ¶
func (*AppConfig) GetDataDir ¶
func (*AppConfig) GetPrivateDir ¶
func (*AppConfig) GetPublicDir ¶
type DBConfig ¶
type DBConfig struct { Type string `yaml:"type"` Host string `yaml:"host"` Port int `yaml:"port"` Name string `yaml:"name"` User string `yaml:"user"` Passwd string `yaml:"passwd"` MaxConn int `yaml:"max_conn"` IdleConn int `yaml:"idle_conn"` Debug bool `yaml:"debug"` }
DBConfig Database (PostgreSQL) configuration
type MqttConfig ¶
type SysConfig ¶
type SysConfig struct { Appid string `yaml:"appid"` Location string `yaml:"location"` Workdir string `yaml:"workdir"` Debug bool `yaml:"debug"` }
SysConfig System Configuration
Click to show internal directories.
Click to hide internal directories.