prompter

package
v2.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CliPrompter

type CliPrompter struct {
}

CliPrompter used to prompt for cli input

func NewCli

func NewCli() *CliPrompter

NewCli builds a new cli prompter

func (*CliPrompter) Choose

func (cli *CliPrompter) Choose(pr string, options []string) int

Choose given the choice return the option selected

func (*CliPrompter) ChooseWithDefault

func (cli *CliPrompter) ChooseWithDefault(pr string, defaultValue string, options []string) (string, error)

ChooseWithDefault given the choice return the option selected with a default

func (*CliPrompter) Password

func (cli *CliPrompter) Password(pr string) string

Password prompt for password which is required

func (*CliPrompter) RequestSecurityCode

func (cli *CliPrompter) RequestSecurityCode(pattern string) string

RequestSecurityCode request a security code to be entered by the user

func (*CliPrompter) String

func (cli *CliPrompter) String(pr string, defaultValue string) string

StringRequired prompt for string which is required

func (*CliPrompter) StringRequired

func (cli *CliPrompter) StringRequired(pr string) string

StringRequired prompt for string which is required

type Prompter

type Prompter interface {
	RequestSecurityCode(string) string
	ChooseWithDefault(string, string, []string) (string, error)
	Choose(string, []string) int
	StringRequired(string) string
	String(string, string) string
	Password(string) string
}

Prompter handles prompting user for input

Jump to

Keyboard shortcuts

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