prompts

package
v0.0.0-...-4df811a Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(message string) bool

Base confirm prompt `message` is the question to confirm (e.g. "Continue"). promptui will append a question mark at the end

func ConfirmCiConfigurationRemoval

func ConfirmCiConfigurationRemoval(serviceName string) bool

ConfirmCiConfigurationRemoval function asks confirmation for the CI service removal

func ConfirmDotKeystonDirRemoval

func ConfirmDotKeystonDirRemoval() bool

ConfirmDotKeystonDirRemoval function aks confirmation for complete .keystone removal

func ConfirmFileRemove

func ConfirmFileRemove(filePath, environmentName string, forceYes bool) bool

ConfirmFileRemove function asks confirmation for file removal

func ConfirmFileReset

func ConfirmFileReset(forceYes bool) bool

ConfirmFileReset function asks confirmation to reset the local contents of a file

func ConfirmHookOverwrite

func ConfirmHookOverwrite(hook *core.Hook) bool

ConfirmHookOverwrite function asks the user to confirm they want to overwrite the hook

func ConfirmHookRemoval

func ConfirmHookRemoval(hook *core.Hook) bool

func ConfirmOverrideFileContents

func ConfirmOverrideFileContents() bool

ConfirmOverrideFileContents function asks confirmation for ovirriding existing file contents

func ConfirmOverrideSecretValue

func ConfirmOverrideSecretValue(forceYes bool) bool

ConfirmOverrideSecretValue function asks confirmation to override existing secret value

func ConfirmProjectDestruction

func ConfirmProjectDestruction(projectName string, skipPrompts bool) bool

ConfirmProjectDestruction function as confirmation for project destruction

func ConfirmRevokeAccessToMember

func ConfirmRevokeAccessToMember(memberId string, forceYes bool) bool

ConfirmRevokeAccessToMember asks the user to confirm they want to revoke the access to the given member, unless `forceYes` is true, in which case it returns true without asking the user.

func ConfirmSendEnvironmentToCiService

func ConfirmSendEnvironmentToCiService(environmentName string, skipPrompts bool) bool

ConfirmSendEnvironmentToCiService function asks confirmation to send environment to CI service

func DeviceName

func DeviceName(existingName string, forceDefault bool) string

DeviceName asks the user to enter a device name. If there is no existing name, it will use the device hostname as default

func OrganizationsSelect

func OrganizationsSelect(
	organizations []models.Organization,
) models.Organization

Asks the usre to select from a list of organizations

func PasswordToDecrypt

func PasswordToDecrypt() string

PasswordToDecrypt function promps the user the passphrase to decrypt the backup

func PasswordToEncrypt

func PasswordToEncrypt() string

PasswordToEncrypt function prompts the user a passphrase to encrypt the backup

func PromptRole

func PromptRole(memberId string, roles []models.Role) (models.Role, error)

Prompts to select a role for a user `memberId` is a `username@service` userID `roles` is a list of roles to select from Returns the selected role

func Select

func Select(message string, items []string) (index int, selected string)

Default selection user interface. `message` is a message to give some context to the user `items` is a list of things to select from. Return the index of the item selected in the `items` list, and the string

func SelectAuthService

func SelectAuthService(serviceName string) string

SelectAuthService function asks the user which third party to use for authentication

func SelectDevice

func SelectDevice(devices []models.Device) models.Device

Asks the user to select from a list of devices

func ServiceConfigurationToRemove

func ServiceConfigurationToRemove() string

ServiceConfigurationToRemove function prompts the CI service name to remove

func ServiceIntegrationName

func ServiceIntegrationName() string

ServiceIntegrationName function prompts the CI integration name

func StringInput

func StringInput(message string, defaultValue string) string

Ask the user to enter a free form input

func StringInputWithValidation

func StringInputWithValidation(
	message string,
	defaultValue string,
	validation promptui.ValidateFunc,
) string

Ask the user to enter a free form input, but runs the user input against a validation function

func ValueForEnvironment

func ValueForEnvironment(
	secretName, environmentName, defaultValue string,
) string

ValueForEnvironment function prompts the secret value for an environment

Types

type SelectCIServiceItem

type SelectCIServiceItem struct {
	Name string
	Type string
}

Items for SelectCIService prompt

func SelectCIService

func SelectCIService(items []SelectCIServiceItem) SelectCIServiceItem

Asks the user to select from a list of CI services

Jump to

Keyboard shortcuts

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