Documentation ¶
Index ¶
- Variables
- func Get[T OptionType](c Ctx, key string) T
- type BoolOption
- type Cmd
- type Ctx
- type FloatOption
- type FloatSlice
- type FloatSliceOption
- type IntOption
- type IntSlice
- type IntSliceOption
- type Intercept
- type Map
- type MapOption
- type Option
- type OptionType
- type StringMap
- type StringMapOption
- type StringOption
- type StringSlice
- type StringSliceOption
- type UintOption
- type UintSlice
- type UintSliceOption
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAssertion = errors.New("assertion error")
Functions ¶
func Get ¶
func Get[T OptionType](c Ctx, key string) T
Types ¶
type BoolOption ¶
func (BoolOption) Help ¶
func (o BoolOption) Help() string
func (BoolOption) Invalid ¶
func (o BoolOption) Invalid() bool
func (BoolOption) Key ¶
func (o BoolOption) Key() string
func (BoolOption) Var ¶
func (o BoolOption) Var() interface{}
type Cmd ¶
type Ctx ¶
type Ctx interface { context.Context Args() []string Option(string) Option Bool(string) bool Int(string) int Uint(string) uint Float(string) float64 String(string) string StringSlice(string) []string IntSlice(string) []int UintSlice(string) []uint FloatSlice(string) []float64 StringMap(string) map[string]string Map(string) map[string]interface{} }
type FloatOption ¶
func (FloatOption) Help ¶
func (o FloatOption) Help() string
func (FloatOption) Invalid ¶
func (o FloatOption) Invalid() bool
func (FloatOption) Key ¶
func (o FloatOption) Key() string
func (FloatOption) Var ¶
func (o FloatOption) Var() interface{}
type FloatSlice ¶
type FloatSlice []float64
func (*FloatSlice) Set ¶
func (s *FloatSlice) Set(value string) error
func (*FloatSlice) String ¶
func (s *FloatSlice) String() string
type FloatSliceOption ¶
func (FloatSliceOption) Help ¶
func (o FloatSliceOption) Help() string
func (FloatSliceOption) Invalid ¶
func (o FloatSliceOption) Invalid() bool
func (FloatSliceOption) Key ¶
func (o FloatSliceOption) Key() string
func (FloatSliceOption) Var ¶
func (o FloatSliceOption) Var() interface{}
type IntSliceOption ¶
func (IntSliceOption) Help ¶
func (o IntSliceOption) Help() string
func (IntSliceOption) Invalid ¶
func (o IntSliceOption) Invalid() bool
func (IntSliceOption) Key ¶
func (o IntSliceOption) Key() string
func (IntSliceOption) Var ¶
func (o IntSliceOption) Var() interface{}
type OptionType ¶
type StringMapOption ¶
func (StringMapOption) Help ¶
func (o StringMapOption) Help() string
func (StringMapOption) Invalid ¶
func (o StringMapOption) Invalid() bool
func (StringMapOption) Key ¶
func (o StringMapOption) Key() string
func (StringMapOption) Var ¶
func (o StringMapOption) Var() interface{}
type StringOption ¶
func (StringOption) Help ¶
func (o StringOption) Help() string
func (StringOption) Invalid ¶
func (o StringOption) Invalid() bool
func (StringOption) Key ¶
func (o StringOption) Key() string
func (StringOption) Var ¶
func (o StringOption) Var() interface{}
type StringSlice ¶
type StringSlice []string
func (*StringSlice) Set ¶
func (s *StringSlice) Set(value string) error
func (*StringSlice) String ¶
func (s *StringSlice) String() string
type StringSliceOption ¶
func (StringSliceOption) Help ¶
func (o StringSliceOption) Help() string
func (StringSliceOption) Invalid ¶
func (o StringSliceOption) Invalid() bool
func (StringSliceOption) Key ¶
func (o StringSliceOption) Key() string
func (StringSliceOption) Var ¶
func (o StringSliceOption) Var() interface{}
type UintOption ¶
func (UintOption) Help ¶
func (o UintOption) Help() string
func (UintOption) Invalid ¶
func (o UintOption) Invalid() bool
func (UintOption) Key ¶
func (o UintOption) Key() string
func (UintOption) Var ¶
func (o UintOption) Var() interface{}
type UintSliceOption ¶
func (UintSliceOption) Help ¶
func (o UintSliceOption) Help() string
func (UintSliceOption) Invalid ¶
func (o UintSliceOption) Invalid() bool
func (UintSliceOption) Key ¶
func (o UintSliceOption) Key() string
func (UintSliceOption) Var ¶
func (o UintSliceOption) Var() interface{}
Click to show internal directories.
Click to hide internal directories.