terminal

package
v0.11.1-0...-8ab92b3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() *terminal

New returns an Outputer interface

Types

type Asker

type Asker interface {
	Ask(message, fallback, sep string, validator Validator) (string, error)
}

type Outputer

type Outputer interface {
	Ask(message, fallback, sep string, validator Validator) (string, error)
	Confirm(message string, fallback bool, sep string) (bool, error)
	Info(s ...string)
	Success(s ...string)
	Pending(s ...string)
	Select(r io.Reader, msg string, opts []string) (int, error)
	Warning()
	Done()
}

Outputer is an interface that captures the output to a terminal. It is used to make our output consistent in the command line.

type Validator

type Validator interface {
	Validate(input string) error
}

Validator is used to pass information into a terminal prompt for validating inputs that are strings

Jump to

Keyboard shortcuts

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