Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultCommandName = "go-search-file" DefaultDaemon = false DefaultBaseDir = constant.CurrentDir DefaultLogDir = "./log" MinLogMaxSize = 1 MaxLogMaxSize = constant.MaxInt MinLogMaxDays = 1 MaxLogMaxDays = constant.MaxInt MinLogMaxBackups = 1 MaxLogMaxBackups = constant.MaxInt )
global constant
View Source
const ( ConfKey = "config" DaemonKey = "daemon" LogFileNameKey = "log.fileName" LogLevelKey = "log.level" LogFormatKey = "log.format" LogMaxSizeKey = "log.maxSize" LogMaxDaysKey = "log.maxDays" LogMaxBackupsKey = "log.maxBackups" PathKey = "path" KeywordKey = "keyword" )
configuration constant
Variables ¶
View Source
var ( ValidLogLevels = []string{"debug", "info", "warn", "warning", "error", "fatal"} ValidLogFormats = []string{"text", "json"} )
Functions ¶
func SetDefaultConfig ¶
func SetDefaultConfig(baseDir string)
SetDefaultConfig set default configuration, it is the lowest priority
func TrimSpaceOfArg ¶
TrimSpaceOfArg trims spaces of given argument
func ValidateConfig ¶
func ValidateConfig() (err error)
ValidateConfig validates if the configuration is valid
func ValidateDaemon ¶
func ValidateDaemon() error
ValidateDaemon validates if daemon section is valid
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.