Documentation ¶
Index ¶
- func AskYesNo(reader io.Reader, message string, defaultAnswer bool) bool
- func GetErrorOutput() io.Writer
- func GetOutput() io.Writer
- func OsStdoutIsTerminal() bool
- func Print(a ...interface{}) (n int, err error)
- func Printf(format string, a ...interface{}) (n int, err error)
- func Println(a ...interface{}) (n int, err error)
- func ReadLine() (string, error)
- func ReadPassword() (string, error)
- func SetAllOutput(w io.Writer)
- func SetErrorOutput(w io.Writer)
- func SetOutput(w io.Writer)
- type RemoteTerm
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetErrorOutput ¶
GetErrorOutput returns the error output of the Print* functions
func OsStdoutIsTerminal ¶ added in v0.14.0
func OsStdoutIsTerminal() bool
OsStdoutIsTerminal returns true as os.Stdout is a terminal session
func Print ¶
Print formats using the default formats for its operands and writes to standard output. Spaces are added between operands when neither is a string. It returns the number of bytes written and any write error encountered.
Example ¶
SetOutput(os.Stdout) Print("ExamplePrint")
Output: ExamplePrint
func Printf ¶
Printf formats according to a format specifier and writes to standard output. It returns the number of bytes written and any write error encountered.
func Println ¶
Println formats using the default formats for its operands and writes to standard output. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered.
func ReadPassword ¶
ReadPassword reads a password without echoing it to the terminal.
func SetAllOutput ¶
SetAllOutput changes the default and error output for the Print* functions
func SetErrorOutput ¶
SetErrorOutput changes the error output for the Print* functions
Types ¶
type RemoteTerm ¶
type RemoteTerm struct {
// contains filtered or unexported fields
}
RemoteTerm is used to send terminal output remotely
func NewRemoteTerm ¶
func NewRemoteTerm(client *remote.Client) *RemoteTerm
NewRemoteTerm creates a new RemoteTerm based on a remote.Client