Documentation ¶
Index ¶
- Variables
- func BoolToBoolValueFunc() mapstructure.DecodeHookFunc
- func Float64ToUintValueFunc() mapstructure.DecodeHookFunc
- func StringToDurationValueFunc() mapstructure.DecodeHookFunc
- func StringToStringValueFunc() mapstructure.DecodeHookFunc
- func Visit(path string, visitor VisitFn) error
- type AppendSliceValue
- type BoolValue
- type DurationValue
- type StringValue
- type UintValue
- type VisitFn
Constants ¶
This section is empty.
Variables ¶
var ConfigDecodeHook = mapstructure.ComposeDecodeHookFunc( BoolToBoolValueFunc(), StringToDurationValueFunc(), StringToStringValueFunc(), Float64ToUintValueFunc(), )
ConfigDecodeHook should be passed to mapstructure in order to decode into the *Value objects here.
Functions ¶
func BoolToBoolValueFunc ¶
func BoolToBoolValueFunc() mapstructure.DecodeHookFunc
BoolToBoolValueFunc is a mapstructure hook that looks for an incoming bool mapped to a BoolValue and does the translation.
func Float64ToUintValueFunc ¶
func Float64ToUintValueFunc() mapstructure.DecodeHookFunc
Float64ToUintValueFunc is a mapstructure hook that looks for an incoming float64 mapped to a UintValue and does the translation.
func StringToDurationValueFunc ¶
func StringToDurationValueFunc() mapstructure.DecodeHookFunc
StringToDurationValueFunc is a mapstructure hook that looks for an incoming string mapped to a DurationValue and does the translation.
func StringToStringValueFunc ¶
func StringToStringValueFunc() mapstructure.DecodeHookFunc
StringToStringValueFunc is a mapstructure hook that looks for an incoming string mapped to a StringValue and does the translation.
Types ¶
type AppendSliceValue ¶
type AppendSliceValue []string
AppendSliceValue implements the flag.Value interface and allows multiple calls to the same variable to append a list.
func (*AppendSliceValue) Set ¶
func (s *AppendSliceValue) Set(value string) error
func (*AppendSliceValue) String ¶
func (s *AppendSliceValue) String() string
type BoolValue ¶
type BoolValue struct {
// contains filtered or unexported fields
}
BoolValue provides a flag value that's aware if it has been set.
func (*BoolValue) IsBoolFlag ¶
IsBoolFlag is an optional method of the flag.Value interface which marks this value as boolean when the return value is true. See flag.Value for details.
type DurationValue ¶
type DurationValue struct {
// contains filtered or unexported fields
}
DurationValue provides a flag value that's aware if it has been set.
func (*DurationValue) Merge ¶
func (d *DurationValue) Merge(onto *time.Duration)
Merge will overlay this value if it has been set.
func (*DurationValue) Set ¶
func (d *DurationValue) Set(v string) error
Set implements the flag.Value interface.
func (*DurationValue) String ¶
func (d *DurationValue) String() string
String implements the flag.Value interface.
type StringValue ¶
type StringValue struct {
// contains filtered or unexported fields
}
StringValue provides a flag value that's aware if it has been set.
func (*StringValue) Merge ¶
func (s *StringValue) Merge(onto *string)
Merge will overlay this value if it has been set.
func (*StringValue) Set ¶
func (s *StringValue) Set(v string) error
Set implements the flag.Value interface.
func (*StringValue) String ¶
func (s *StringValue) String() string
String implements the flag.Value interface.