diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2022-12-22 11:21:29 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-22 11:21:29 +1100 |
| commit | e3e31e3cbc2a2c030dc51f7cd6a15ccdfc956873 (patch) | |
| tree | b22c67ac62a9a44334328576a1b957716fdf7eb7 /internal/configuration/types.go | |
| parent | 0732e60e16c61391d57b34313812e12fb5f08701 (diff) | |
refactor(commands): command context (#4539)
This moves a lot of machinery for commands into a context.Context with other struct values. This allows for PreRunE's to reliably load the configuration and avoids use of global vars.
Diffstat (limited to 'internal/configuration/types.go')
| -rw-r--r-- | internal/configuration/types.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/configuration/types.go b/internal/configuration/types.go index 32a15fb5e..4c0236dc8 100644 --- a/internal/configuration/types.go +++ b/internal/configuration/types.go @@ -21,28 +21,28 @@ type YAMLFileSource struct { filters []FileFilter } -// EnvironmentSource is a configuration Source which loads values from the environment. +// EnvironmentSource is a configuration configuration.Source which loads values from the environment. type EnvironmentSource struct { koanf *koanf.Koanf prefix string delimiter string } -// SecretsSource loads environment variables that have a value pointing to a file. +// SecretsSource is a configuration.Source which loads environment variables that have a value pointing to a file. type SecretsSource struct { koanf *koanf.Koanf prefix string delimiter string } -// CommandLineSource loads configuration from the command line flags. +// CommandLineSource is a configuration.Source which loads configuration from the command line flags. type CommandLineSource struct { koanf *koanf.Koanf flags *pflag.FlagSet callback func(flag *pflag.Flag) (string, any) } -// MapSource loads configuration from the command line flags. +// MapSource is a configuration.Source which loads configuration from the command line flags. type MapSource struct { m map[string]any koanf *koanf.Koanf |
