prompts

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2017 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const NumberMask = '#'

NumberMask is the character used to mask number inputs

View Source
const PasswordMask = '●'

PasswordMask is the character used to mask password inputs

Variables

This section is empty.

Functions

func Confirm

func Confirm(msg string) (string, error)

Confirm is a confirmation prompt

func CouponCode

func CouponCode() (string, error)

CouponCode prompts the user to input an alphanumeric coupon code.

func CreditCard

func CreditCard() (*stripe.Token, error)

CreditCard handles receiving and tokenizing payment information

func Email

func Email(defaultValue string) (string, error)

Email prompts the user to provide an email *or* accepted the default email value

func EmailVerificationCode

func EmailVerificationCode(defaultValue string) (string, error)

EmailVerificationCode prompts the user to input a person's name

func FullName

func FullName(defaultValue string) (string, error)

FullName prompts the user to input a person's name

func HandleSelectError

func HandleSelectError(err error, generic string) error

HandleSelectError returns a cli error if the error is not an EOF or Interrupt

func NewSpinner

func NewSpinner(suffix string) *spinner.Spinner

NewSpinner returns a customized spinner

func Password

func Password() (string, error)

Password prompts the user to input a password value

func ProjectDescription

func ProjectDescription(defaultValue string, autoSelect bool) (string, error)

ProjectDescription prompts the user to enter a project description

func ProjectTitle added in v0.8.1

func ProjectTitle(defaultValue string, autoSelect bool) (string, error)

ProjectTitle prompts the user to enter a new project title

func ResourceName

func ResourceName(defaultValue string, autoSelect bool) (string, error)

ResourceName prompts the user to provide a label name

func ResourceTitle added in v0.8.1

func ResourceTitle(defaultValue string, autoSelect bool) (string, error)

ResourceTitle prompts the user to provide a resource title or to accept empty to let the system generate one.

func SelectAPIToken added in v0.8.1

func SelectAPIToken(tokens []*iModels.APIToken) (*iModels.APIToken, error)

SelectAPIToken prompts the user to choose from a list of tokens

func SelectContext

func SelectContext(teams []*iModels.Team, label string, userTuple *[]string) (int, string, error)

SelectContext runs a SelectTeam for context purposes

func SelectPlan

func SelectPlan(plans []*cModels.Plan, label string, filterLabelTop bool) (int, string, error)

SelectPlan prompts the user to select a plan from the given list.

func SelectProduct

func SelectProduct(products []*cModels.Product, label string) (int, string, error)

SelectProduct prompts the user to select a product from the given list.

func SelectProject

func SelectProject(projects []*mModels.Project, label string, emptyOption bool) (int, string, error)

SelectProject prompts the user to select a project from the given list.

func SelectProvider

func SelectProvider(providers []*cModels.Provider) (*cModels.Provider, error)

SelectProvider prompts the user to select a provider resource from the given list.

func SelectRegion

func SelectRegion(regions []*cModels.Region) (int, string, error)

SelectRegion prompts the user to select a region from the given list.

func SelectResource

func SelectResource(resources []*mModels.Resource, projects []*mModels.Project,
	label string) (int, string, error)

SelectResource promps the user to select a provisioned resource from the given list

func SelectRole added in v0.8.0

func SelectRole() (string, error)

SelectRole prompts the user to select a role from the given list.

func SelectTeam

func SelectTeam(teams []*iModels.Team, label string, userTuple *[]string) (int, string, error)

SelectTeam prompts the user to select a team from the given list. -1 as the first return value indicates no team has been selected

func SpinStart

func SpinStart(suffix string)

SpinStart starts the spinning animation for the global spinner

func SpinStop

func SpinStop()

SpinStop stopts the Spinner animation for the global spinner

func TeamTitle added in v0.8.1

func TeamTitle(defaultValue string, autoSelect bool) (string, error)

TeamTitle prompts the user to enter a new Team title

func TokenDescription added in v0.8.1

func TokenDescription() (string, error)

TokenDescription prompts the user to enter a token description

Types

This section is empty.

Jump to

Keyboard shortcuts

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