Documentation
¶
Index ¶
- func Config(set *goflag.FlagSet, name string, usage string, opts ...ucfg.Option) *ucfg.Config
- func ConfigVar(set *goflag.FlagSet, def *ucfg.Config, name string, usage string, ...) *ucfg.Config
- type FileLoader
- type FlagValue
- func ConfigFiles(set *goflag.FlagSet, name string, usage string, ...) *FlagValue
- func ConfigFilesExts(set *goflag.FlagSet, name string, usage string, opts ...ucfg.Option) *FlagValue
- func ConfigFilesExtsVar(set *goflag.FlagSet, def *ucfg.Config, name string, usage string, ...) *FlagValue
- func ConfigFilesVar(set *goflag.FlagSet, def *ucfg.Config, name string, usage string, ...) *FlagValue
- func ConfigJSONFiles(set *goflag.FlagSet, name string, usage string, opts ...ucfg.Option) *FlagValue
- func ConfigJSONFilesVar(set *goflag.FlagSet, def *ucfg.Config, name string, usage string, ...) *FlagValue
- func ConfigYAMLFiles(set *goflag.FlagSet, name string, usage string, opts ...ucfg.Option) *FlagValue
- func ConfigYAMLFilesVar(set *goflag.FlagSet, def *ucfg.Config, name string, usage string, ...) *FlagValue
- func NewFlagFiles(cfg *ucfg.Config, extensions map[string]FileLoader, opts ...ucfg.Option) *FlagValue
- func NewFlagKeyValue(cfg *ucfg.Config, autoBool bool, opts ...ucfg.Option) *FlagValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileLoader ¶
type FlagValue ¶
type FlagValue struct {
// contains filtered or unexported fields
}
func ConfigFiles ¶
func ConfigFilesExts ¶
func ConfigFilesExtsVar ¶
func ConfigFilesVar ¶
func ConfigJSONFiles ¶
func ConfigJSONFilesVar ¶
func ConfigYAMLFiles ¶
func ConfigYAMLFilesVar ¶
func NewFlagFiles ¶
func NewFlagFiles( cfg *ucfg.Config, extensions map[string]FileLoader, opts ...ucfg.Option, ) *FlagValue
func NewFlagKeyValue ¶
NewFlagKeyValue implements the flag.Value interface for capturing ucfg.Config settings from command line arguments. Configuration options follow the argument name and must be in the form of "key=value". Using 'D' as command line flag for example, options on command line must be given as:
-D key1=value -D key=value
Note: the space between command line option and key is required by the flag package to parse command line flags correctly.
Note: it's valid to use a key multiple times. If keys are used multiple times, values get overwritten. The last known value for some key will be stored in the generated configuration.
The type of value must be any of bool, uint, int, float, or string. Any kind of array or object syntax is not supported.
If autoBool is enabled (default if Config or ConfigVar is used), keys without value are converted to bool variable with value being true.