Documentation
¶
Overview ¶
Package config provides configuration file support for the Idsec CLI.
It loads a YAML configuration file that sets default values for IDSEC_* environment variables. Environment variables already set in the process take precedence over config file values.
Index ¶
Constants ¶
const (
// ConfigFileEnvVar is the environment variable that overrides the default config file path.
ConfigFileEnvVar = "IDSEC_CONFIG_FILE"
)
Variables ¶
This section is empty.
Functions ¶
func ExtractConfigFlag ¶
func ExtractConfigFlag() string
ExtractConfigFlag scans os.Args for a --config flag value before Cobra parses the command line, so the config file can be loaded early in startup.
func LoadConfigFile ¶
func LoadConfigFile(path string)
LoadConfigFile reads the YAML config file and sets environment variables for recognized keys that are not already present in the environment. Accepted keys are any key starting with IDSEC_, plus the standard proxy variables HTTP_PROXY, HTTPS_PROXY, and NO_PROXY (and their lowercase forms). A missing file is silently ignored. Parse errors or unrecognized keys produce warnings but do not cause the CLI to fail.
func ResolveConfigFilePath ¶
ResolveConfigFilePath determines the configuration file path using the following precedence: CLI flag value, IDSEC_CONFIG_FILE env var, default path.
Types ¶
This section is empty.