Documentation ¶
Overview ¶
Package goconfig uses a struct as input and populates the fields of this struct with parameters fom command line, environment variables and configuration file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Tag to set main name of field Tag = "cfg" // TagDefault to set default value TagDefault = "cfgDefault" // TagHelper to set usage help line TagHelper = "cfgHelper" // Path sets default config path Path string // File name of default config file File string // FileRequired config file required FileRequired bool // HelpString temporarily saves help HelpString string // PrefixFlag is a string that would be placed at the beginning of the generated Flag tags. PrefixFlag string // PrefixEnv is a string that would be placed at the beginning of the generated Event tags. PrefixEnv string // ErrFileFormatNotDefined Is the error that is returned when there is no defined configuration file format. ErrFileFormatNotDefined = errors.New("file format not defined") //Usage is a function to show the help, can be replaced by your own version. Usage func() // Formats is the list of registered formats. Formats []Fileformat // FileEnv is the environment variable that define the config file FileEnv string // PathEnv is the environment variable that define the config file path PathEnv string // WatchConfigFile is the flag to update the config when the config file changes WatchConfigFile bool // DisableFlags on the command line DisableFlags bool )
Functions ¶
func ParseAndWatch ¶
ParseAndWatch configuration returns a channel for errors while watching files and anorther when each update has been detected
Types ¶
Click to show internal directories.
Click to hide internal directories.