Documentation ¶
Index ¶
- Constants
- type ChoiceParam
- type ChoicesParam
- type InputParam
- func (p *InputParam) Desc() string
- func (p *InputParam) Name() string
- func (p *InputParam) Run() (err error)
- func (p *InputParam) Set(v string) error
- func (p *InputParam) SetFunc(fn RunFn)
- func (p *InputParam) SetValidFn(fn func(val string) error)
- func (p *InputParam) String() string
- func (p *InputParam) Type() string
- func (p *InputParam) Valid(v string) error
- func (p *InputParam) Value() structs.Value
- type RunFn
- type StringParam
Constants ¶
View Source
const ( TypeStringParam = "string" TypeChoicesParam = "choices" )
params types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChoiceParam ¶
type ChoiceParam struct { InputParam // Choices for select Choices []string // contains filtered or unexported fields }
ChoiceParam definition
func (*ChoiceParam) WithChoices ¶
func (p *ChoiceParam) WithChoices(Choices []string) *ChoiceParam
WithChoices to param definition
type ChoicesParam ¶ added in v3.2.0
type ChoicesParam struct { InputParam // Choices for select Choices []string // contains filtered or unexported fields }
ChoicesParam definition
func NewChoicesParam ¶ added in v3.2.0
func NewChoicesParam(name, desc string) *ChoicesParam
NewChoicesParam instance
func (*ChoicesParam) Run ¶ added in v3.2.0
func (p *ChoicesParam) Run() (err error)
Run param and get user input
func (*ChoicesParam) Selected ¶ added in v3.2.0
func (p *ChoicesParam) Selected() []string
Selected values get
func (*ChoicesParam) WithChoices ¶ added in v3.2.0
func (p *ChoicesParam) WithChoices(Choices []string) *ChoicesParam
WithChoices to param definition
type InputParam ¶
type InputParam struct { // Default value Default any ValidFn func(val string) error // contains filtered or unexported fields }
InputParam struct
func (*InputParam) SetValidFn ¶
func (p *InputParam) SetValidFn(fn func(val string) error)
SetValidFn for run
type StringParam ¶
type StringParam struct {
InputParam
}
StringParam definition
func (*StringParam) Config ¶
func (p *StringParam) Config(fn func(p *StringParam)) *StringParam
Config param
Click to show internal directories.
Click to hide internal directories.