terminal

package
v1.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TTY

type TTY struct {
	// contains filtered or unexported fields
}

TTY represents unixish stdio, possibly with /dev/tty used to read user input

func OpenTTY

func OpenTTY() *TTY

func (*TTY) DetermineWidth

func (t *TTY) DetermineWidth() int

func (*TTY) Error

func (t *TTY) Error() io.Writer

func (*TTY) Output

func (t *TTY) Output() io.Writer

func (*TTY) ReadPassword

func (t *TTY) ReadPassword(prompt string) string

func (*TTY) SetDefaultPassword

func (t *TTY) SetDefaultPassword(password string)

type Terminal

type Terminal interface {
	Output() io.Writer
	Error() io.Writer
	SetDefaultPassword(password string)
	ReadPassword(prompt string) string
	DetermineWidth() int
}

Terminal handles interacting with the user in Certigo

type TestTerminal

type TestTerminal struct {
	OutputBuf bytes.Buffer
	ErrorBuf  bytes.Buffer
	Password  string
	Width     int
}

TestTerminal just collects input into buffers That can be used to check output in tests

func (TestTerminal) DetermineWidth

func (t TestTerminal) DetermineWidth() int

func (*TestTerminal) Error

func (t *TestTerminal) Error() io.Writer

func (*TestTerminal) Output

func (t *TestTerminal) Output() io.Writer

func (*TestTerminal) ReadPassword

func (t *TestTerminal) ReadPassword(prompt string) string

func (*TestTerminal) SetDefaultPassword

func (t *TestTerminal) SetDefaultPassword(password string)

Jump to

Keyboard shortcuts

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