prompt

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	// Prompt container for sequence of prompts
	Prompts []Prompt
}

func (*Array) GetResults

func (array *Array) GetResults() *viper.Viper

func (*Array) Read

func (array *Array) Read() error

type Autocomplete

type Autocomplete struct {
	// Prompt message
	Msg string

	// Autocomplete selection options
	Options []string

	// Default option
	Default string

	// Prompt error massage for incorrect input
	ErrMsg string

	// Prompt confirmation massage for incorrect input
	ConfirmationMsg string

	// Default option for confirmation prompt
	ConfirmationDefault string

	// Return value will be saved under Label key
	Label string
	// contains filtered or unexported fields
}

func (*Autocomplete) GetResults

func (autocomplete *Autocomplete) GetResults() *viper.Viper

func (*Autocomplete) Read

func (autocomplete *Autocomplete) Read() error

type Prompt

type Prompt interface {
	// Read the input from the user
	Read() error
	// Get results
	GetResults() *viper.Viper
}

type Simple

type Simple struct {
	// Prompt message
	Msg string

	// Default value
	Default string

	// Mask user input, mainly for passwords input
	Mask bool

	// Return value will be saved under Label key
	Label string
	// contains filtered or unexported fields
}

func (*Simple) GetResults

func (simple *Simple) GetResults() *viper.Viper

func (*Simple) Read

func (simple *Simple) Read() error

type YesNo

type YesNo struct {
	// Prompt message
	Msg string

	// Default value
	Default string

	// Prompt container for positive outcome
	Yes Prompt

	// Prompt container for negative outcome
	No Prompt

	// Return value will be saved under Label key
	Label string
	// contains filtered or unexported fields
}

func (*YesNo) GetResults

func (yesNo *YesNo) GetResults() *viper.Viper

func (*YesNo) Read

func (yesNo *YesNo) Read() error

Jump to

Keyboard shortcuts

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