config

package
v0.0.0-...-2ee14e4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCommandName = "go-mod"
	DefaultBaseDir     = constant.CurrentDir

	DefaultModParent            = "parent"
	DefaultModChild             = "child"
	DefaultModAll               = "all"
	DefaultModDir               = "./"
	DefaultModName              = constant.EmptyString
	DefaultModVersion           = constant.EmptyString
	DefaultModUseCompileVersion = false
)

global constant

View Source
const (
	LogLevelKey  = "log.level"
	LogFormatKey = "log.format"

	ModDirKey               = "mod.dir"
	ModNameKey              = "mod.name"
	ModVersionKey           = "mod.version"
	ModUseCompileVersionKey = "mod.useCompileVersion"
)

configuration constant

Variables

View Source
var (
	ValidLogLevels  = []string{"debug", "info", "warn", "warning", "error", "fatal"}
	ValidLogFormats = []string{"text", "json"}
)
View Source
var (
	AppName    string
	Version    string
	BuildTime  string
	FullCommit string
	Branch     string
)

Functions

func FullInfo

func FullInfo() string

func SetDefaultConfig

func SetDefaultConfig(baseDir string)

SetDefaultConfig set default configuration, it is the lowest priority

func SetDefaultLog

func SetDefaultLog(baseDir string)

SetDefaultLog sets the default value of log

func SetDefaultMod

func SetDefaultMod()

SetDefaultMod sets the default value of mod

func ShortInfo

func ShortInfo() string

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 ValidateLog

func ValidateLog() error

ValidateLog validates if log section is valid.

func ValidateMod

func ValidateMod() error

ValidateMod validates if mod 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