Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ConfigItemDebug defines the Viper config item for running in debug mode ConfigItemDebug = "debug" // ConfigItemDryRun defines the Viper config item for enabling dry-run mode ConfigItemDryRun = "dry_run" )
Variables ¶
This section is empty.
Functions ¶
func AddConfigItems ¶
func AddConfigItems(configKeys []string)
AddConfigItems adds a new configuration item, and makes it overridable by env vars
func AddConfigItemsWithPFlags ¶ added in v0.2.6
AddConfigItemsWithFlags adds a new configuration item, as above, but also binds to a PFlag of the same name. NOTE: The PFlag must already have been created with something like:
_ = pflag.String("host", "h", "Host to lookup")
Types ¶
type Config ¶ added in v0.3.0
type Config struct { // File is the default config file name File string // Dir is an additional directory to search for config files Dir string // EnvPrefix allows you to add a Viper "EnvPrefix" to config env-vars EnvPrefix string // UseOnlyDir disables looking for a config file in "$HOME" or "." directories. OnlyUseDir bool }
Config provides the App Config for some of the app-wide settings
Click to show internal directories.
Click to hide internal directories.