Documentation
¶
Index ¶
- Variables
- func MissingRequiredVar(name string) error
- func UnsupportedType(kind reflect.Kind) error
- type BoolVar
- type DataSource
- type Int16Var
- type Int32Var
- type Int64Var
- type IntVar
- type KeyValueSource
- type KeyValueSource2
- type MissingRequiredVarError
- type Options
- type Source
- type StringVar
- type Uint16Var
- type Uint32Var
- type Uint64Var
- type UintVar
- type UnsupportedTypeErrror
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDataSourceIsNil = errors.New("data source is nil")
)
Functions ¶
func MissingRequiredVar ¶
func UnsupportedType ¶
Types ¶
type BoolVar ¶
type BoolVar struct {
// contains filtered or unexported fields
}
func RequiredBool ¶
type DataSource ¶
DataSource represents a data source which can apply to Options
func CommandLine ¶
func CommandLine() DataSource
CommandLine creates DataSource from flag.CommandLine
func FlagSet ¶
func FlagSet(flagSet *flag.FlagSet) DataSource
FlagSet creates DataSource from flag.FlagSet
func FormString ¶
func FormString(s string) (DataSource, error)
FormString creates DataSource from raw form string
func FromKV ¶
func FromKV(kv KeyValueSource) DataSource
FromKV converts KeyValueSource to DataSource
func FromKV2 ¶
func FromKV2(kv KeyValueSource2) DataSource
FromKV2 converts KeyValueSource2 to DataSource
type Int16Var ¶
type Int16Var struct {
// contains filtered or unexported fields
}
func RequiredInt16 ¶
type Int32Var ¶
type Int32Var struct {
// contains filtered or unexported fields
}
func RequiredInt32 ¶
type Int64Var ¶
type Int64Var struct {
// contains filtered or unexported fields
}
func RequiredInt64 ¶
type KeyValueSource ¶
type KeyValueSource2 ¶
type MissingRequiredVarError ¶
type MissingRequiredVarError string
func (MissingRequiredVarError) Error ¶
func (e MissingRequiredVarError) Error() string
type StringVar ¶
type StringVar struct {
// contains filtered or unexported fields
}
func RequiredString ¶
type Uint16Var ¶
type Uint16Var struct {
// contains filtered or unexported fields
}
func RequiredUint16 ¶
type Uint32Var ¶
type Uint32Var struct {
// contains filtered or unexported fields
}
func RequiredUint32 ¶
type Uint64Var ¶
type Uint64Var struct {
// contains filtered or unexported fields
}
func RequiredUint64 ¶
type UintVar ¶
type UintVar struct {
// contains filtered or unexported fields
}
func RequiredUint ¶
type UnsupportedTypeErrror ¶
type UnsupportedTypeErrror struct {
// contains filtered or unexported fields
}
func (UnsupportedTypeErrror) Error ¶
func (e UnsupportedTypeErrror) Error() string
Click to show internal directories.
Click to hide internal directories.