Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAppConfig = &AppConfig{ System: SysConfig{ Appid: "Logsight", Location: "Asia/Shanghai", Workdir: "/var/logsight", 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: "logsight", User: "postgres", Passwd: "myroot", MaxConn: 100, IdleConn: 10, Debug: false, }, Syslogd: SyslogdConfig{ Host: "0.0.0.0", Port: 1814, Debug: true, }, Logger: LogConfig{ Mode: "development", ConsoleEnable: true, LokiEnable: false, FileEnable: true, Filename: "/var/logsight/logsight.log", QueueSize: 4096, LokiApi: "http://127.0.0.1:3100", LokiUser: "logsight", LokiPwd: "logsight", LokiJob: "logsight", MetricsStorage: "/var/logsight/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"` Syslogd SyslogdConfig `yaml:"syslogd" json:"syslogd"` 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 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 SysConfig ¶
type SysConfig struct { Appid string `yaml:"appid"` Location string `yaml:"location"` Workdir string `yaml:"workdir"` Debug bool `yaml:"debug"` }
SysConfig 系统配置
type SyslogdConfig ¶
Click to show internal directories.
Click to hide internal directories.