config

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//Version string.
	Version = major + "." + minor + "." + patch
)

Variables

View Source
var (
	Values Config
	// Used for flags.
	CfgFile     string
	UserLicense string
	Author      string
	//DefautConfigFile holds the Golangspell's config file path
	DefautConfigFile string = ConfigFilePath
)

Values stores the current configuration values

View Source
var ConfigFilePath = fmt.Sprintf("%s%s%s", GetGolangspellHome(), PlatformSeparator, configFileName)

ConfigFilePath contains the path of the config file

View Source
var PlatformIsWindows = getPlatformIsWindows()

PlatformIsWindows checks if the application is running on Windows

View Source
var PlatformSeparator = getPlatformSeparator()

PlatformSeparator specific for the current platform

Functions

func GetGolangspellHome added in v0.0.6

func GetGolangspellHome() string

GetGolangspellHome - platform agnostic

func GetHomeDir

func GetHomeDir() string

GetHomeDir provides the User's Home Directory

func GetModuleName added in v0.3.5

func GetModuleName(currentPath string) string

GetModuleName from the current application based in the go.mod file

Types

type Config

type Config struct {
	//LogLevel - DEBUG or INFO or WARNING or ERROR or PANIC or FATAL
	LogLevel string
	//TestRun state if the current execution is a test execution
	TestRun bool
	//GoPath contains the configured or by convention GOPATH
	GoPath string
}

Config contains the application's configuration values. Add here your own variables and bind it on init() function

Jump to

Keyboard shortcuts

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