prompt

package
v0.0.414 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package prompt implements input-related functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(ctx context.Context, message string) (confirm bool, err error)

func ConfirmOverwrite added in v0.0.337

func ConfirmOverwrite(ctx context.Context, filename string) (confirm bool, err error)

func Confirmf

func Confirmf(ctx context.Context, format string, a ...interface{}) (bool, error)

func Int added in v0.0.367

func Int(ctx context.Context, dst *int, msg string, def int, required bool) error

func IsNonInteractive

func IsNonInteractive(err error) bool

func MultiRegion added in v0.0.367

func MultiRegion(ctx context.Context, msg string, currentRegions []string, excludedRegionCodes []string) (*[]api.Region, error)

Region returns the region the user has passed in via flag or prompts the user for one.

func MultiSelect added in v0.0.367

func MultiSelect(ctx context.Context, indices *[]int, msg string, def []int, options ...string) error

func MultiSelectRegion added in v0.0.367

func MultiSelectRegion(ctx context.Context, msg string, regions []api.Region, currentRegions []string) (selectedRegions []api.Region, err error)

func Org

func Org(ctx context.Context) (*api.Organization, error)

Org returns the Organization the user has passed in via flag or prompts the user for one.

func Password

func Password(ctx context.Context, dst *string, msg string, required bool) error

func Region

func Region(ctx context.Context, params RegionParams) (*api.Region, error)

Region returns the region the user has passed in via flag or prompts the user for one.

func Select

func Select(ctx context.Context, index *int, msg, def string, options ...string) error

func SelectOrg

func SelectOrg(ctx context.Context, orgs []api.Organization) (org *api.Organization, err error)

func SelectRegion

func SelectRegion(ctx context.Context, msg string, regions []api.Region, defaultCode string) (region *api.Region, err error)

func SelectVMSize added in v0.0.367

func SelectVMSize(ctx context.Context, vmSizes []api.VMSize) (vmSize *api.VMSize, err error)

func String

func String(ctx context.Context, dst *string, msg, def string, required bool) error

func VMSize added in v0.0.367

func VMSize(ctx context.Context, def string) (size *api.VMSize, err error)

Types

type NonInteractiveError

type NonInteractiveError string

func (NonInteractiveError) Error

func (e NonInteractiveError) Error() string

func (NonInteractiveError) Unwrap

func (NonInteractiveError) Unwrap() error

type RegionParams added in v0.0.400

type RegionParams struct {
	Message             string
	ExcludedRegionCodes []string
}

Jump to

Keyboard shortcuts

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