Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClosablePromptInput ¶
type ClosablePromptInput struct {
io.ReadCloser
// contains filtered or unexported fields
}
ClosablePromptInput wraps an io.ReadCloser into PromptInput.
func (*ClosablePromptInput) Close ¶
func (i *ClosablePromptInput) Close() error
Close closes the underlying ReadCloser.
func (*ClosablePromptInput) Interrupt ¶
func (i *ClosablePromptInput) Interrupt() error
Interrupt closes the underlying ReadCloser once.
type PromptInput ¶
type PromptInput interface {
io.ReadCloser
Interrupt() error
}
PromptInput wraps an interruptible input stream.
func DuplicatePromptInput ¶
func DuplicatePromptInput(input io.Reader) (PromptInput, error)
DuplicatePromptInput duplicates an input stream and equips it with an interrupt pipe.
type Prompter ¶
type Prompter interface {
ReadLine(ctx context.Context, prompt string) (string, error)
ReadSecret(ctx context.Context, prompt string) (string, error)
}
Prompter provides interruptible terminal input for lines and secrets. ReadLine echoes console text and accepts Enter on Windows; ReadSecret never echoes secret input. Redirected streams are read without terminal echo.
Click to show internal directories.
Click to hide internal directories.