prompts

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: BSD-3-Clause Imports: 19 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

View Source
var IsInteractive = true

IsInteractive tells whether a terminal support interaction, such as prompts and colors.

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 CredentialAlias added in v0.10.0

func CredentialAlias(creds []*mModels.Credential) (*mModels.Credential, string, string, error)

CredentialAlias asks the user to supply a new alias for the given cred

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 InvitationCode added in v0.11.0

func InvitationCode(defaultValue string) (string, error)

InvitationCode prompts the user to input an invitation token to join a team.

func Name added in v0.9.0

func Name(field, defaultValue string, autoSelect, allowEmpty bool) (string, error)

Name prompts the user to provide a Name value

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, name string, userTuple *[]string) (int, string, error)

SelectContext runs a SelectTeam for context purposes

func SelectCredential added in v0.10.0

func SelectCredential(creds []*mModels.Credential) (*mModels.Credential, string, error)

SelectCredential prompts the user to choose from a list of credentials

func SelectPlan

func SelectPlan(list []*cModels.Plan, name string) (int, string, error)

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

func SelectProduct

func SelectProduct(list []*cModels.Product, name string) (int, string, error)

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

func SelectProject

func SelectProject(list []*mModels.Project, name string, emptyOption, showResult bool) (int, string, error)

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

func SelectProvider

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

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

func SelectRegion

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

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

func SelectResource

func SelectResource(list []*mModels.Resource, projects []*mModels.Project,
	name 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(roles []string) (string, error)

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

func SelectTeam

func SelectTeam(teams []*iModels.Team, name 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 Title added in v0.9.0

func Title(field, defaultValue string, autoSelect, allowEmpty bool) (string, error)

Title prompts the user to provide a Title value

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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