Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompleteKeyValue ¶
func CompleteKeyValue(keys []string, completed string) ([]string, cobra.ShellCompDirective)
CompleteKeyValue returns key=value completions using the given slice of keys.
func CompleteLogLevel ¶
CompleteLogLevel returns completions for the LogLevel type.
Types ¶
type KeyValue ¶
KeyValue is a flag that takes in a key=value format.
type KeyValueArray ¶
type KeyValueArray struct { Pairs []KeyValue // contains filtered or unexported fields }
KeyValueArray is a flag type that takes in key=value on each flag value and can be specified multiple times.
func (*KeyValueArray) Append ¶
func (s *KeyValueArray) Append(val string) error
Append parses a "key=value" string and adds that to this array.
func (*KeyValueArray) GetSlice ¶
func (s *KeyValueArray) GetSlice() []string
GetSlice returns a slice of "key=value" string representations for all the values.
func (*KeyValueArray) Replace ¶
func (s *KeyValueArray) Replace(val []string) error
Replace parses a slice of "key=value" strings and sets those as this flag's new values.
func (*KeyValueArray) Set ¶
func (s *KeyValueArray) Set(val string) error
Set parses a "key=value" string and updates this flag with that value, overriding the array if it's the first time its set, or appends the value if it's a consecutive call.
func (*KeyValueArray) String ¶
func (s *KeyValueArray) String() string
String returns a "[key1=value,key2=value]" string represetntation for this flag.
func (*KeyValueArray) Type ¶
func (s *KeyValueArray) Type() string
Type returns the name of this type.
type LogLevel ¶
LogLevel is a pflag.Value-compatible logging level flag for wharf-core's logger.Level type.
func (*LogLevel) Set ¶
Set implements the pflag.Value interface. This parses the loglevel string and updates the loglevel variable.