terminal

package
v0.0.0-...-45a6ba4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Terminal

type Terminal struct {
	Input       io.Reader
	Output      io.Writer
	ErrorOutput io.Writer
}

Terminal represents the terminal with input, output and error output.

func New

func New(in io.Reader, out io.Writer, errorOut io.Writer) Terminal

New terminal instance.

func (Terminal) Confirm

func (t Terminal) Confirm(prompt string) bool

Confirm asks the user for confirmation. If the answer is y, yes, or sure, the used confirmed, otherwise not.

func (Terminal) Hidden

func (t Terminal) Hidden(prompt string) (string, error)

Hidden reads from Input, but typed characters are hidden. Good for passwords, tokens, or other sensitive information.

func (Terminal) Read

func (t Terminal) Read(prompt string) (string, error)

Read text from input with optional prompt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL