config

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

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

func TrimSpaceOfArg(arg string) string

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

func ValidateExcel

func ValidateExcel() error

ValidateServer validates if server section is valid

func ValidateLog

func ValidateLog() error

ValidateLog validates if log section is valid.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL