Documentation
¶
Index ¶
Constants ¶
const ( TypeInt = "int" TypeString = "string" )
set of known flag types
Variables ¶
This section is empty.
Functions ¶
func MarkHidden ¶
MarkHidden marks the specified flag as hidden from the provided flag set TODO(REALMC-8369): this method should go away if/when we can get golangci-lint to play nicely with errcheck and our exclude .errcheck file For now, we use this to isolate and minimize the nolint directives in this repo
Types ¶
type Arg ¶
type Arg struct {
Name string
Value interface{}
}
Arg is a flag arg represented by its name and optional value
type EnumSetValue ¶
type EnumSetValue struct {
// contains filtered or unexported fields
}
EnumSetValue is a modified copy of stringSliceValue from the cobra pflags package. It validates a set of enum values. Note: it does NOT maintain order of the input arguments
func NewEnumSet ¶
func NewEnumSet(p *[]string, validValues []interface{}) *EnumSetValue
NewEnumSet creates an EnumSetValue. Expects p to point to an empty slice and will clear it otherwise.
func (*EnumSetValue) Append ¶
func (esv *EnumSetValue) Append(val string) error
Append appends a single value to an EnumSetValue
func (*EnumSetValue) GetSlice ¶
func (esv *EnumSetValue) GetSlice() []string
GetSlice returns the underlying slice of the set of the EnumSetValue
func (*EnumSetValue) Replace ¶
func (esv *EnumSetValue) Replace(values []string) error
Replace replaces all values in an EnumSetValue
func (*EnumSetValue) Set ¶
func (esv *EnumSetValue) Set(val string) error
Set adds new values to the EnumSetValue
func (*EnumSetValue) String ¶
func (esv *EnumSetValue) String() string
String returns a string representation of an EnumSetValue
func (*EnumSetValue) Type ¶
func (esv *EnumSetValue) Type() string
Type returns the type string of EnumSetValue