Documentation ¶
Index ¶
- Variables
- func IsTerminalInteractive(in io.Reader, out io.Writer) bool
- func Required(s string) (string, error)
- func ValidateFilePath(path string, opt FileValidatorOptions) error
- type FilePicker
- type FileValidatorOptions
- type IOStreams
- func (s IOStreams) Error(messages string)
- func (s *IOStreams) Execute(model tea.Model, opts ...tea.ProgramOption) (tea.Model, error)
- func (s IOStreams) GetOutput() io.Writer
- func (s IOStreams) Info(messages string)
- func (s IOStreams) IsInteractive() bool
- func (s IOStreams) MsgE(message string, style lipgloss.Style, stream *lipgloss.Renderer) error
- func (s IOStreams) Print(messages string)
- func (s IOStreams) Warn(messages string)
- func (s *IOStreams) Wizard(title string, completedTitle string) wizard.Handler
- type InputPrompt
- type InputSourceSwitch
- type MultiSelect
- type NonInteractiveStyles
- type SingleSelect
- type TextInput
- type ValidateAndMap
- type ValidateTextAndMapFn
- type Zeroable
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInterrupted = errors.New("input was interrupted")
)
View Source
var (
ErrValueIsNotSet = errors.New("value is not set")
)
Functions ¶
func IsTerminalInteractive ¶ added in v0.25.3
func ValidateFilePath ¶
func ValidateFilePath(path string, opt FileValidatorOptions) error
Types ¶
type FilePicker ¶
type FileValidatorOptions ¶
type IOStreams ¶
func NewIOStreams ¶
func NewTestIOStreams ¶ added in v0.23.1
func (IOStreams) IsInteractive ¶
type InputPrompt ¶
type InputSourceSwitch ¶
type InputSourceSwitch[V, T any] struct { DefaultValue Zeroable[V] Optional bool InteractivePromptFn func() (InputPrompt[V], error) ValidateAndMap ValidateAndMap[V, T] ErrMessage string // contains filtered or unexported fields }
func (*InputSourceSwitch[V, T]) GetValue ¶
func (iss *InputSourceSwitch[V, T]) GetValue(streams IOStreams) (T, error)
func (*InputSourceSwitch[V, T]) Validate ¶
func (iss *InputSourceSwitch[V, T]) Validate(streams IOStreams) error
type MultiSelect ¶
type MultiSelect struct { Prompt string Items []string ValidateAndMap ValidateAndMap[[]string, []string] }
type NonInteractiveStyles ¶ added in v0.25.3
type NonInteractiveStyles struct { InfoStyle lipgloss.Style WarnHeadingStyle lipgloss.Style WarnMessageStyle lipgloss.Style Bold lipgloss.Style Status wizard.TaskStatusStyle }
func NewNonInteractiveStyles ¶ added in v0.25.3
func NewNonInteractiveStyles() NonInteractiveStyles
type SingleSelect ¶
type TextInput ¶
type TextInput[V interface{}] struct { Prompt string InitialValue string Placeholder string ValidateAndMap ValidateTextAndMapFn[V] }
type ValidateAndMap ¶
func NewFileValidator ¶
func NewFileValidator(opt FileValidatorOptions) ValidateAndMap[string, string]
type ValidateTextAndMapFn ¶
type Zeroable ¶
Zeroable this interface is required to check if a value is not set we could use simply "comparable" as generic constraint, but slices are not comparable, which makes them impossible to use. This interface abstracts helps mitigate the issue
func AsZeroable ¶
func AsZeroable[V comparable](value V) Zeroable[V]
func AsZeroableSlice ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.