Documentation
¶
Index ¶
- func Blanked(src []byte) ([]byte, []byte)
- func CaretNotation(src []byte) ([]byte, []byte)
- func Masked(src []byte) ([]byte, []byte)
- type SignalError
- type Terminal
- func (t *Terminal) Close() error
- func (t *Terminal) ContextReader(ctx context.Context) (io.ReadCloser, error)
- func (t *Terminal) GetSize() (width, height int, err error)
- func (t *Terminal) MakeRaw() error
- func (t *Terminal) Read(p []byte) (int, error)
- func (t *Terminal) ReadCustom(ctx context.Context, prompt string, transform Transformer) (s []byte, err error)
- func (t *Terminal) ReadLine(ctx context.Context, prompt string) ([]byte, error)
- func (t *Terminal) ReadNoEcho(ctx context.Context, prompt string) ([]byte, error)
- func (t *Terminal) ReadPassword(ctx context.Context, prompt string) ([]byte, error)
- func (t *Terminal) Restore() error
- func (t *Terminal) Write(p []byte) (int, error)
- type Transformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaretNotation ¶
CaretNotation displays control characters in caret notation.
Types ¶
type SignalError ¶
SignalError indicates that the operation was interrupted by a signal.
func (SignalError) Error ¶
func (e SignalError) Error() string
type Terminal ¶ added in v0.4.0
type Terminal struct {
// contains filtered or unexported fields
}
Terminal represents a terminal.
func NewTerminal ¶ added in v0.4.0
NewTerminal opens a terminal.
func (*Terminal) ContextReader ¶ added in v0.5.0
ContextReader returns an io.ReadCloser that cancels the Read operation when context's Done channel is closed.
func (*Terminal) ReadCustom ¶ added in v0.5.0
func (t *Terminal) ReadCustom(ctx context.Context, prompt string, transform Transformer) (s []byte, err error)
ReadCustom reads a line from the terminal with custom transform function.
func (*Terminal) ReadNoEcho ¶ added in v0.4.0
ReadNoEcho reads a line from the terminal without local echo.
func (*Terminal) ReadPassword ¶ added in v0.4.0
ReadPassword reads a line from the terminal with masking.
type Transformer ¶
Transformer transforms src into its display form and a sequence of backspaces for deleting it.
Click to show internal directories.
Click to hide internal directories.