Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var New = newPrompt
New instantiates a prompt which satisfied Prompt with c-bata/go-prompt. New will be replace by a mock when e2e testing.
Prompt will panic when called Run if executor is nil.
TODO: Don't declare New as a variable.
Functions ¶
This section is empty.
Types ¶
type Prompt ¶
type Prompt interface { // Run executes Input continually. // It is called from REPL input prompter. // Run will be finished when a user enters CTRL+d. Run() // Input receives user entered input. // Input will be abort when a user enters CTRL+d. Input() (string, error) // Select displays a selection has options, opts. Select(msg string, opts []string) (string, error) // SetPrefix changes the current prompt prefix by passed one. SetPrefix(prefix string) // SetPrefixColor changes the current prompt color by passed one. SetPrefixColor(color color.Color) error // History returns Input() history as a string slice. // A older command is a newer executed command. History() []string }
Prompt provides interactive interfaces to receive user input.
Click to show internal directories.
Click to hide internal directories.