Documentation ¶
Index ¶
- func Resolve(args map[string][]string, flagSet apiserverflag.NamedFlagSets) []error
- func ResolveIgnoreMissing(args map[string][]string, flagSet apiserverflag.NamedFlagSets) []error
- type ComponentFlag
- func (f *ComponentFlag) Allowed() sets.String
- func (f *ComponentFlag) Bind(flags *pflag.FlagSet, flagFormat, messagePrefix string)
- func (f *ComponentFlag) Calculated() sets.String
- func (f *ComponentFlag) DefaultDisable(components ...string) *ComponentFlag
- func (f *ComponentFlag) DefaultEnable(components ...string) *ComponentFlag
- func (f *ComponentFlag) Disable(components ...string)
- func (f *ComponentFlag) Enabled(name string) bool
- func (f *ComponentFlag) Expand(value string) sets.String
- func (f *ComponentFlag) Mappings() map[string][]string
- func (f *ComponentFlag) Validate() (sets.String, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
func Resolve(args map[string][]string, flagSet apiserverflag.NamedFlagSets) []error
func ResolveIgnoreMissing ¶
func ResolveIgnoreMissing(args map[string][]string, flagSet apiserverflag.NamedFlagSets) []error
ResolveIgnoreMissing resolves flags in the args, but does not fail on missing flags. It silently skips those. It's useful for building subsets of the full options, but validation should do a normal binding.
Types ¶
type ComponentFlag ¶
type ComponentFlag struct {
// contains filtered or unexported fields
}
ComponentFlag represents a set of enabled components used in a command line.
func NewComponentFlag ¶
func NewComponentFlag(mappings map[string][]string, allowed ...string) *ComponentFlag
NewComponentFlag returns a flag that represents the allowed components and can be bound to command line flags.
func (*ComponentFlag) Allowed ¶
func (f *ComponentFlag) Allowed() sets.String
Allowed returns a copy of the allowed list of components.
func (*ComponentFlag) Bind ¶
func (f *ComponentFlag) Bind(flags *pflag.FlagSet, flagFormat, messagePrefix string)
Bind registers the necessary flags with a flag set.
func (*ComponentFlag) Calculated ¶
func (f *ComponentFlag) Calculated() sets.String
Calculated returns the effective enabled list.
func (*ComponentFlag) DefaultDisable ¶
func (f *ComponentFlag) DefaultDisable(components ...string) *ComponentFlag
DefaultDisable resets the default enabled set to all allowed components except the provided.
func (*ComponentFlag) DefaultEnable ¶
func (f *ComponentFlag) DefaultEnable(components ...string) *ComponentFlag
DefaultEnable resets the enabled components to only those provided that are also in the allowed list.
func (*ComponentFlag) Disable ¶
func (f *ComponentFlag) Disable(components ...string)
Disable marks the provided components as disabled.
func (*ComponentFlag) Enabled ¶
func (f *ComponentFlag) Enabled(name string) bool
Enabled returns true if the component is enabled.
func (*ComponentFlag) Expand ¶
func (f *ComponentFlag) Expand(value string) sets.String
Expand turns a string into a fully expanded set of components, resolving any mappings.
func (*ComponentFlag) Mappings ¶
func (f *ComponentFlag) Mappings() map[string][]string
Mappings returns a copy of the mapping list for short names.