Documentation ¶
Overview ¶
Package common contains many useful functions for logging, config, etc.
Index ¶
- func CompatibleLog(conf *Config) string
- func GetFileNameDayAndOldDay(conf *Config, prefix string) (string, string)
- func GetLastNum(str string, split string) int
- func Hostname(conf *Config) string
- func MyNewLogger(conf *Config, logFile string) *logs.BeeLogger
- func NewMySQLConnection(conf *Config) (mysql.Conn, error)
- type BaseConf
- type Config
- type DatabaseConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompatibleLog ¶
CompatibleLog for making log_file and log_dir compatible
func GetFileNameDayAndOldDay ¶
GetFileNameDayAndOldDay get name of new file and old file
func GetLastNum ¶
GetLastNum get file name number suffix
func MyNewLogger ¶
MyNewLogger constructor of needed logger
Types ¶
type BaseConf ¶
type BaseConf struct { BaseDir string SnapshotDir string SnapshotDay int LogDir string Endpoint string LogFile string LogLevel int FalconClient string IgnoreFile string }
BaseConf config about dir, log, etc.
type Config ¶
type Config struct { Base BaseConf DataBase DatabaseConf }
Config for initializing. This can be loaded from TOML file with -c
Click to show internal directories.
Click to hide internal directories.