prompt

package
v0.0.0-...-b1e9806 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Choose

func Choose(name, message string, required bool, optionsFn OptionsFunc) (string, error)

Choose will resolve a configuration item by asking the user to select a value from a list

func ChooseAndSet

func ChooseAndSet(cfg config.ConfigurationSet, name, message string, required bool, optionsFn OptionsFunc) error

ChooseAndSet will resolve and set a configuration item by asking the user to select a value from a list

func Confirm

func Confirm(name, message string, required bool) (bool, error)

Input will ask the user to enter a value

func Input

func Input(name, message string, required bool) (string, error)

Input will ask the user to enter a value

func InputAndSet

func InputAndSet(cfg config.ConfigurationSet, name, message string, required bool) error

InputAndSet will resolve and set a configuration item by asking the user to enter a value

func InputSensitiveAndSet

func InputSensitiveAndSet(cfg config.ConfigurationSet, name, message string, required bool) error

InputSensitiveAndSet will resolve and set a configuration item by asking the user to enter a value but it won't show the value eneterd

Types

type OptionsFunc

type OptionsFunc func() (map[string]string, error)

OptionsFunc is a function that will return the list of options to select from in the form if a map that is displayname:value

func OptionsFromConfigList

func OptionsFromConfigList(listName string) OptionsFunc

OptionsFromConfigList will return an options func based on a list from the app config

func OptionsFromMap

func OptionsFromMap(values map[string]string) OptionsFunc

OptionsFromMap will create a OptionsFunc from a map

func OptionsFromStringSlice

func OptionsFromStringSlice(values []string) OptionsFunc

OptionsFromStringSlice will create a OptionsFunc from a slice of strings

Jump to

Keyboard shortcuts

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