Documentation ¶
Index ¶
- Variables
- func BoolToBoolValueFunc() mapstructure.DecodeHookFunc
- func Float64ToUintValueFunc() mapstructure.DecodeHookFunc
- func Merge(dst, src *flag.FlagSet)
- func StringToDurationValueFunc() mapstructure.DecodeHookFunc
- func StringToStringValueFunc() mapstructure.DecodeHookFunc
- func Usage(txt string, flags *flag.FlagSet) string
- func Visit(path string, visitor VisitFn) error
- type AppendSliceValue
- type BoolValue
- type DurationValue
- type FlagMapValue
- type HTTPFlags
- func (f *HTTPFlags) APIClient() (*api.Client, error)
- func (f *HTTPFlags) Addr() string
- func (f *HTTPFlags) ClientFlags() *flag.FlagSet
- func (f *HTTPFlags) Datacenter() string
- func (f *HTTPFlags) MergeOntoConfig(c *api.Config)
- func (f *HTTPFlags) ServerFlags() *flag.FlagSet
- func (f *HTTPFlags) Stale() bool
- func (f *HTTPFlags) Token() string
- type StringValue
- type UintValue
- type Usager
- 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 FlagMapValue ¶
FlagMapValue is a flag implementation used to provide key=value semantics multiple times.
func (*FlagMapValue) Set ¶
func (h *FlagMapValue) Set(value string) error
func (*FlagMapValue) String ¶
func (h *FlagMapValue) String() string
type HTTPFlags ¶
type HTTPFlags struct {
// contains filtered or unexported fields
}
func (*HTTPFlags) ClientFlags ¶
func (*HTTPFlags) Datacenter ¶
func (*HTTPFlags) MergeOntoConfig ¶ added in v1.0.4
func (*HTTPFlags) ServerFlags ¶
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.
type UintValue ¶
type UintValue struct {
// contains filtered or unexported fields
}
UintValue provides a flag value that's aware if it has been set.