input

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

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

Input implements Prompter using the given io.Reader and io.Writer.

func New

func New(in io.Reader, out io.Writer) *Input

New creates a new Input struct with the given io.Reader and io.Writer.

func (*Input) Prompt

func (i *Input) Prompt(msg string) (string, error)

Prompt prompts the user for input with the given message, using the provided io Reader and Writer.

func (*Input) PromptPassword

func (i *Input) PromptPassword(msg string) (string, error)

PromptPassword prompts the user for input that won't be printed back to them.

type Prompter

type Prompter interface {
	Prompt(string) (string, error)
	PromptPassword(string) (string, error)
}

Prompter defines methods used for getting user input.

Jump to

Keyboard shortcuts

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