terminal

package
v0.0.0-...-098adc7 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2015 License: Apache-2.0 Imports: 6 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerTerm

type DockerTerm struct{}

func (*DockerTerm) DisableEcho

func (*DockerTerm) DisableEcho(fd uintptr, state *term.State) error

func (*DockerTerm) GetWinsize

func (*DockerTerm) GetWinsize(fd uintptr) (width, height int)

func (*DockerTerm) IsTTY

func (*DockerTerm) IsTTY(fd uintptr) bool

func (*DockerTerm) RestoreTerminal

func (*DockerTerm) RestoreTerminal(fd uintptr, state *term.State) error

func (*DockerTerm) SaveState

func (*DockerTerm) SaveState(fd uintptr) (*term.State, error)

func (*DockerTerm) SetRawTerminal

func (*DockerTerm) SetRawTerminal(fd uintptr) (*term.State, error)

type FdReader

type FdReader interface {
	io.Reader
	Fd() uintptr
}

type PasswordReader

type PasswordReader interface {
	PromptForPassword(promptText string, args ...interface{}) string
}

type Term

type Term interface {
	SaveState(fd uintptr) (*term.State, error)
	RestoreTerminal(fd uintptr, state *term.State) error
	DisableEcho(fd uintptr, state *term.State) error
}

type TermPasswordReader

type TermPasswordReader struct {
	Term   Term
	Stdin  FdReader
	Stdout io.Writer
}

func NewPasswordReader

func NewPasswordReader() *TermPasswordReader

func (*TermPasswordReader) PromptForPassword

func (pr *TermPasswordReader) PromptForPassword(promptText string, args ...interface{}) string

type UI

type UI interface {
	io.ReadWriter
	PasswordReader

	Prompt(promptText string, args ...interface{}) string
	PromptWithDefault(promptText, defaultValue string, args ...interface{}) string
	Say(format string, args ...interface{})
	SayIncorrectUsage(message string)
	SayLine(format string, args ...interface{})
	SayNewLine()
}

func NewUI

func NewUI(input io.Reader, output io.Writer, passwordReader PasswordReader) UI

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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