prompts

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(defaultAnswer bool, q string, v ...interface{}) (answer bool)

Confirm - prompt the user for a yes/no answer

func InputOrDefault

func InputOrDefault(defaultValue, q string, v ...interface{}) (answer string, err error)

InputOrDefault - ask user for mandatory input

func InputRequired

func InputRequired(q string, v ...interface{}) (answer string, err error)

InputRequired - ask user for mandatory input

func Password

func Password(q string, v ...interface{}) (password string, err error)

Password - ask user for password input

func PrettyMap

func PrettyMap(data map[string]interface{})

PrettyMap - pretty print a map

func Select

func Select(q string, options ...Option) (err error)

Select - render a select field

Types

type Option

type Option struct {
	Label string
	Func  func() error
}

Option - to be used for a select input

func NewOption

func NewOption(label string, op func() error) Option

NewOption - create a new option

Jump to

Keyboard shortcuts

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