Documentation ¶
Index ¶
- func AskAndAnswerCustomSelect(title string, list []SelectItem) (string, error)
- func AskForProvider() (string, error)
- func CreateCustomSelectPrompt(title string, completeList []SelectItem) promptui.Select
- func GetAnswerFromCustomPrompt(prompt promptui.Select, list []SelectItem) (string, error)
- func ValidateAreYouSure(input string) error
- func ValidateDropletName(input string) error
- type SelectItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskAndAnswerCustomSelect ¶
func AskAndAnswerCustomSelect(title string, list []SelectItem) (string, error)
AskAndAnswerCustomSelect will ask a custom select question and return the selected answer as a string
func AskForProvider ¶
AskForProvider will ask the user which provider they would like to use returns the selected provider as a string
func CreateCustomSelectPrompt ¶
func CreateCustomSelectPrompt(title string, completeList []SelectItem) promptui.Select
CreateCustomSelectPrompt will create a customised formatted select prompt to be used to ask the user a multi-select question
func GetAnswerFromCustomPrompt ¶
func GetAnswerFromCustomPrompt(prompt promptui.Select, list []SelectItem) (string, error)
GetAnswerFromCustomPrompt will take in a select prompt (usually custom), a list of items returns the selected answer as a string
func ValidateAreYouSure ¶
ValidateAreYouSure will check whether they entered yes
func ValidateDropletName ¶
ValidateDropletName will check whether they entered a valid droplet name
Types ¶
type SelectItem ¶
SelectItem is used for custom selects
func ParseDropletListResults ¶
func ParseDropletListResults(list []godo.Droplet) []SelectItem
ParseDropletListResults will return a list of DigitalOcean ssh keys as SelectItems to be used for promptui
func ParseImageListResults ¶
func ParseImageListResults(list []godo.Image) []SelectItem
ParseImageListResults will return a list of DigitalOcean images as SelectItems to be used for promptui
func ParseRegionListresults ¶
func ParseRegionListresults(list []godo.Region) []SelectItem
ParseRegionListresults will return a list of DigitalOcean regions as SelectItems to be used for promptui
func ParseSSHKeyListResults ¶
func ParseSSHKeyListResults(list []godo.Key) []SelectItem
ParseSSHKeyListResults will return a list of DigitalOcean ssh keys as SelectItems to be used for promptui
func ParseSizeListResults ¶
func ParseSizeListResults(list []godo.Size) []SelectItem
ParseSizeListResults will return a list of DigitalOcean sizes as SelectItems to be used for promptui