Documentation
¶
Index ¶
Constants ¶
View Source
const (
DefaultConfigPath = ".nvkit"
)
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
func InitConfig(cmd *cobra.Command, cfgFile string, cfgPath string, envPrefix string, extraConfigs ...interface{}) (*viper.Viper, error)
InitConfig sets up the basic way to read CLI/File configs for services Configs are read in the following priority (left overrides right):
CLI-Flags -> Config-file -> Env-vars -> Flag-defaults
NOTE:
Sometimes, it is not easy to represent all configs as flags and are best represented in config files - like array of structs. To satisfy these cases we allow passing extraConfigs which will be unmarshalled from config file
func NewTestCommand ¶
func SetupConfig ¶
SetupConfig is a helper function for config flags that exits if the config was not applied correctly
Types ¶
type ComplexConfig ¶
type ComplexConfigInfo ¶
type ComplexConfigInfo struct {
Configs []ComplexConfig `mapstructure:"config"`
}
Click to show internal directories.
Click to hide internal directories.