certigo: github.com/square/certigo/cli/terminal Index | Files

package terminal

import "github.com/square/certigo/cli/terminal"

Index

Package Files

terminal.go testing.go

type TTY Uses

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

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

func OpenTTY Uses

func OpenTTY() *TTY

func (*TTY) DetermineWidth Uses

func (t *TTY) DetermineWidth() int

func (*TTY) Error Uses

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

func (*TTY) Output Uses

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

func (*TTY) ReadPassword Uses

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

func (*TTY) SetDefaultPassword Uses

func (t *TTY) SetDefaultPassword(password string)

type Terminal Uses

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 Uses

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 Uses

func (t TestTerminal) DetermineWidth() int

func (*TestTerminal) Error Uses

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

func (*TestTerminal) Output Uses

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

func (*TestTerminal) ReadPassword Uses

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

func (*TestTerminal) SetDefaultPassword Uses

func (t *TestTerminal) SetDefaultPassword(password string)

Package terminal imports 7 packages (graph) and is imported by 4 packages. Updated 2020-02-14. Refresh now. Tools for package owners.