Versions in this module Expand all Collapse all v0 v0.8.0 Aug 27, 2022 Changes in this version + var ErrNotFinished = errors.New("step is not finished") + var ErrNothingToDo = errors.New("nothing to do") + var ErrSequenceClosed = errors.New("sequence is closed") + var ReactionTime = 10 * time.Millisecond + func IsIgnoredError(err error) bool + func IsInterrupted(err error) bool + func IsNothingTodo(err error) bool + func WaitForReaction() <-chan time.Time + type Action struct + func (a *Action) Do(c Console) error + func (a *Action) String() string + type Answer interface + type Buffer struct + func (b *Buffer) Reset() + func (b *Buffer) String() string + func (b *Buffer) Write(p []byte) (int, error) + type ConfirmAnswer struct + func (a *ConfirmAnswer) Do(c Console) error + func (a *ConfirmAnswer) Interrupted() + func (a *ConfirmAnswer) String() string + type ConfirmPrompt struct + func (c *ConfirmPrompt) Answer(answer string) *ConfirmAnswer + func (c *ConfirmPrompt) Do(console Console) error + func (c *ConfirmPrompt) Interrupt() + func (c *ConfirmPrompt) No() + func (c *ConfirmPrompt) ShowHelp(help string, options ...string) + func (c *ConfirmPrompt) String() string + func (c *ConfirmPrompt) Yes() + type Console interface + Close func() error + Expect func(opts ...expect.ExpectOpt) (string, error) + ExpectEOF func() (string, error) + ExpectString func(s string) (string, error) + Expectf func(format string, args ...interface{}) (string, error) + Fd func() uintptr + Send func(s string) (int, error) + SendLine func(s string) (int, error) + Tty func() *os.File + type ExpectOption func(s *Survey) + type Expector func(t TestingT) *Survey + func Expect(options ...ExpectOption) Expector + type HelpAction struct + func (a *HelpAction) Do(c Console) error + func (a *HelpAction) String() string + type HelpAnswer struct + func (a *HelpAnswer) Do(c Console) error + func (a *HelpAnswer) String() string + type InlineSteps struct + func (s *InlineSteps) String() string + type InputAnswer struct + func (a *InputAnswer) Do(c Console) error + func (a *InputAnswer) Interrupted() + func (a *InputAnswer) String() string + type InputPrompt struct + func (p *InputPrompt) Answer(answer string) *InputAnswer + func (p *InputPrompt) Do(c Console) error + func (p *InputPrompt) Interrupt() + func (p *InputPrompt) Once() *InputPrompt + func (p *InputPrompt) ShowHelp(help string, options ...string) + func (p *InputPrompt) String() string + func (p *InputPrompt) Tab(times ...int) *InputSuggestionSteps + func (p *InputPrompt) Times(i int) *InputPrompt + func (p *InputPrompt) Twice() *InputPrompt + func (p *InputPrompt) Type(s string) *InputSuggestionSteps + type InputSuggestionSteps struct + func (a *InputSuggestionSteps) Delete(times ...int) *InputSuggestionSteps + func (a *InputSuggestionSteps) Do(c Console) error + func (a *InputSuggestionSteps) Enter() + func (a *InputSuggestionSteps) Esc() *InputSuggestionSteps + func (a *InputSuggestionSteps) ExpectSuggestions(suggestions ...string) *InputSuggestionSteps + func (a *InputSuggestionSteps) Interrupt() *InputSuggestionSteps + func (a *InputSuggestionSteps) MoveDown(times ...int) *InputSuggestionSteps + func (a *InputSuggestionSteps) MoveUp(times ...int) *InputSuggestionSteps + func (a *InputSuggestionSteps) String() string + func (a *InputSuggestionSteps) Tab(times ...int) *InputSuggestionSteps + func (a *InputSuggestionSteps) Type(s string) *InputSuggestionSteps + type InterruptAnswer struct + func (a *InterruptAnswer) Do(c Console) error + func (a *InterruptAnswer) String() string + type MultiSelectExpect []string + func (e *MultiSelectExpect) Do(c Console) error + func (e *MultiSelectExpect) String() string + type MultiSelectPrompt struct + func (p *MultiSelectPrompt) Delete(times ...int) *MultiSelectPrompt + func (p *MultiSelectPrompt) Do(c Console) error + func (p *MultiSelectPrompt) Enter() + func (p *MultiSelectPrompt) ExpectOptions(options ...string) *MultiSelectPrompt + func (p *MultiSelectPrompt) Interrupt() + func (p *MultiSelectPrompt) MoveDown(times ...int) *MultiSelectPrompt + func (p *MultiSelectPrompt) MoveUp(times ...int) *MultiSelectPrompt + func (p *MultiSelectPrompt) Select() *MultiSelectPrompt + func (p *MultiSelectPrompt) SelectAll() *MultiSelectPrompt + func (p *MultiSelectPrompt) SelectNone() *MultiSelectPrompt + func (p *MultiSelectPrompt) ShowHelp(help string, options ...string) *MultiSelectPrompt + func (p *MultiSelectPrompt) String() string + func (p *MultiSelectPrompt) Tab(times ...int) *MultiSelectPrompt + func (p *MultiSelectPrompt) Type(s string) *MultiSelectPrompt + type MultilineAnswer struct + func (a *MultilineAnswer) Do(c Console) error + func (a *MultilineAnswer) Interrupted() + func (a *MultilineAnswer) String() string + type MultilinePrompt struct + func (p *MultilinePrompt) Answer(answer string) *MultilineAnswer + func (p *MultilinePrompt) Do(c Console) error + func (p *MultilinePrompt) Interrupt() + func (p *MultilinePrompt) Once() *MultilinePrompt + func (p *MultilinePrompt) String() string + func (p *MultilinePrompt) Times(i int) *MultilinePrompt + func (p *MultilinePrompt) Twice() *MultilinePrompt + type NoAnswer struct + func (a *NoAnswer) Do(c Console) error + func (a *NoAnswer) String() string + type PasswordAnswer struct + func (a *PasswordAnswer) Do(c Console) error + func (a *PasswordAnswer) Interrupted() + func (a *PasswordAnswer) String() string + type PasswordPrompt struct + func (p *PasswordPrompt) Answer(answer string) *PasswordAnswer + func (p *PasswordPrompt) Do(c Console) error + func (p *PasswordPrompt) Interrupt() + func (p *PasswordPrompt) Once() *PasswordPrompt + func (p *PasswordPrompt) ShowHelp(help string, options ...string) + func (p *PasswordPrompt) String() string + func (p *PasswordPrompt) Times(i int) *PasswordPrompt + func (p *PasswordPrompt) Twice() *PasswordPrompt + type Prompt interface + type SelectExpect []string + func (e *SelectExpect) Do(c Console) error + func (e *SelectExpect) String() string + type SelectPrompt struct + func (p *SelectPrompt) Delete(times ...int) *SelectPrompt + func (p *SelectPrompt) Do(c Console) error + func (p *SelectPrompt) Enter() + func (p *SelectPrompt) ExpectOptions(options ...string) *SelectPrompt + func (p *SelectPrompt) Interrupt() + func (p *SelectPrompt) MoveDown(times ...int) *SelectPrompt + func (p *SelectPrompt) MoveUp(times ...int) *SelectPrompt + func (p *SelectPrompt) ShowHelp(help string, options ...string) *SelectPrompt + func (p *SelectPrompt) String() string + func (p *SelectPrompt) Tab(times ...int) *SelectPrompt + func (p *SelectPrompt) Type(s string) *SelectPrompt + type Signal struct + func NewSignal() *Signal + func (s *Signal) Done() <-chan struct{} + func (s *Signal) Notify() + type Step interface + Do func(c Console) error + String func() string + type Steps struct + func (s *Steps) Append(more ...Step) *Steps + func (s *Steps) Close() + func (s *Steps) Do(c Console) error + func (s *Steps) DoFirst(c Console) error + func (s *Steps) ExpectationsWereMet() error + func (s *Steps) HasNothingToDo() bool + func (s *Steps) Len() int + func (s *Steps) Reset() + func (s *Steps) String() string + type StringExpect string + func (e StringExpect) Do(c Console) error + func (e StringExpect) String() string + type StringWriter interface + type Survey struct + func New(t TestingT, options ...ExpectOption) *Survey + func (s *Survey) Expect(c Console) error + func (s *Survey) ExpectConfirm(message string) *ConfirmPrompt + func (s *Survey) ExpectInput(message string) *InputPrompt + func (s *Survey) ExpectMultiSelect(message string) *MultiSelectPrompt + func (s *Survey) ExpectMultiline(message string) *MultilinePrompt + func (s *Survey) ExpectPassword(message string) *PasswordPrompt + func (s *Survey) ExpectSelect(message string) *SelectPrompt + func (s *Survey) ExpectationsWereMet() error + func (s *Survey) ResetExpectations() + func (s *Survey) Start(fn func(stdio terminal.Stdio)) + func (s *Survey) WithTimeout(t time.Duration) *Survey + type TestingT interface + Cleanup func(func()) + Errorf func(format string, args ...interface{}) + FailNow func() + Log func(args ...interface{}) + Logf func(format string, args ...interface{}) + type TypeAnswer struct + func (a *TypeAnswer) Do(c Console) error + func (a *TypeAnswer) String() string