ui

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Empty = DisplayableMap{}

Functions

func Ask

func Ask(message, provided string, defaultValue ...string) string

func AskOrReturnToExit

func AskOrReturnToExit(message string, defaultValue ...string) string

func GetValidatorFor

func GetValidatorFor(prop validation.Validatable) survey.Validator

GetValidatorFor returns an implementation specific validator for the given validatable to avoid type casting at each calling site

func HandleError

func HandleError(err error)

HandleError handles UI-related errors, in particular useful to gracefully handle ctrl-c interrupts gracefully

func MultiSelect

func MultiSelect(message string, options []string, defaultValues []string) []string

func OutputError added in v0.1.11

func OutputError(msg string)

func OutputMessage added in v0.2.0

func OutputMessage(msg string)

func OutputSelection

func OutputSelection(msg, choice string)

func Proceed

func Proceed(message string) bool

Proceed displays a given message and asks the user if they want to proceed

func Select

func Select(message string, options []string, defaultValue ...string) string

func SelectFromOtherErrorMessage added in v0.1.5

func SelectFromOtherErrorMessage(msg, wrong string) string

func SelectOrCheckExisting added in v0.2.0

func SelectOrCheckExisting(parameterValue *string, capitalizedParameterName string, validValues []string, validator func() bool)

Types

type Displayable added in v0.2.0

type Displayable interface {
	Help() string
	Display() string
	Name() string
	GetUnderlying() interface{}
}

func SelectDisplayable added in v0.2.0

func SelectDisplayable(message string, options DisplayableMap, defaultValue ...string) Displayable

type DisplayableMap added in v0.2.0

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

func NewDisplayableMap added in v0.2.0

func NewDisplayableMap(size int) DisplayableMap

func (*DisplayableMap) Add added in v0.2.0

func (d *DisplayableMap) Add(displayable Displayable)

func (DisplayableMap) AsDisplayableOptions added in v0.2.0

func (d DisplayableMap) AsDisplayableOptions() []string

func (DisplayableMap) GetByIndex added in v0.2.0

func (d DisplayableMap) GetByIndex(i int) Displayable

func (DisplayableMap) GetByName added in v0.2.0

func (d DisplayableMap) GetByName(name string) (Displayable, bool)

func (DisplayableMap) Len added in v0.2.0

func (d DisplayableMap) Len() int

func (DisplayableMap) Less added in v0.2.0

func (d DisplayableMap) Less(i, j int) bool

func (DisplayableMap) Swap added in v0.2.0

func (d DisplayableMap) Swap(i, j int)

Jump to

Keyboard shortcuts

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