Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAppConfig = &AppConfig{ System: SysConfig{ Appid: "ToughRADIUS", Location: "Asia/Shanghai", Workdir: "/var/toughradius", Debug: true, }, Web: WebConfig{ Host: "0.0.0.0", Port: 1816, TlsPort: 1817, Secret: "9b6de5cc-0731-1203-xxtt-0f568ac9da37", }, Database: DBConfig{ Type: "postgres", Host: "127.0.0.1", Port: 5432, Name: "toughradius_v8", User: "postgres", Passwd: "myroot", MaxConn: 100, IdleConn: 10, Debug: false, }, Tr069: Tr069Config{ Host: "0.0.0.0", Tls: true, Port: 1819, Secret: "9b6de5cc-0731-1203-xxtt-0f568ac9da37", Debug: true, }, Mqtt: MqttConfig{ Server: "", Username: "", Password: "", Debug: false, }, Freeradius: FreeradiusConfig{ Enabled: true, Host: "0.0.0.0", Port: 1818, Debug: true, }, Radiusd: RadiusdConfig{ Enabled: true, Host: "0.0.0.0", AuthPort: 1812, AcctPort: 1813, RadsecPort: 2083, Debug: true, }, Logger: LogConfig{ Mode: "development", ConsoleEnable: true, LokiEnable: false, FileEnable: true, Filename: "/var/toughradius/toughradius.log", QueueSize: 4096, LokiApi: "http://127.0.0.1:3100", LokiUser: "toughradius", LokiPwd: "toughradius", LokiJob: "toughradius", MetricsStorage: "/var/toughradius/data/metrics", MetricsHistory: 24 * 7, }, }
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"` Freeradius FreeradiusConfig `yaml:"freeradius" json:"freeradius"` Radiusd RadiusdConfig `yaml:"radiusd" json:"radiusd"` Tr069 Tr069Config `yaml:"tr069" json:"tr069"` Mqtt MqttConfig `yaml:"mqtt" json:"mqtt"` Logger LogConfig `yaml:"logger" json:"logger"` }
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 数据库(PostgreSQL)配置
type FreeradiusConfig ¶
type FreeradiusConfig struct { Enabled bool `yaml:"enabled" json:"enabled"` Host string `yaml:"host" json:"host"` Port int `yaml:"port" json:"port"` Debug bool `yaml:"debug" json:"debug"` }
FreeradiusConfig Freeradius API 配置
type LogConfig ¶
type LogConfig struct { Mode string `yaml:"mode"` ConsoleEnable bool `yaml:"console_enable"` LokiEnable bool `yaml:"loki_enable"` FileEnable bool `yaml:"file_enable"` Filename string `yaml:"filename"` QueueSize int `yaml:"queue_size"` LokiApi string `yaml:"loki_api"` LokiUser string `yaml:"loki_user"` LokiPwd string `yaml:"loki_pwd"` LokiJob string `yaml:"loki_job"` MetricsStorage string `yaml:"metrics_storage"` MetricsHistory int `yaml:"metrics_history"` }
type MqttConfig ¶
type RadiusdConfig ¶
type RadiusdConfig struct { Enabled bool `yaml:"enabled" json:"enabled"` Host string `yaml:"host" json:"host"` AuthPort int `yaml:"auth_port" json:"auth_port"` AcctPort int `yaml:"acct_port" json:"acct_port"` RadsecPort int `yaml:"radsec_port" json:"radsec_port"` Debug bool `yaml:"debug" json:"debug"` }
type SysConfig ¶
type SysConfig struct { Appid string `yaml:"appid"` Location string `yaml:"location"` Workdir string `yaml:"workdir"` Debug bool `yaml:"debug"` }
SysConfig 系统配置
Click to show internal directories.
Click to hide internal directories.