config

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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 NewTestCommand() *cobra.Command

func SetupConfig

func SetupConfig(configName string, success bool)

SetupConfig is a helper function for config flags that exits if the config was not applied correctly

Types

type ComplexConfig

type ComplexConfig struct {
	Name  string `mapstructure:"name"`
	Prop1 string `mapstructure:"prop1"`
	Prop2 string `mapstructure:"prop2"`
}

type ComplexConfigInfo

type ComplexConfigInfo struct {
	Configs []ComplexConfig `mapstructure:"config"`
}

Jump to

Keyboard shortcuts

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