Documentation ¶
Index ¶
- Variables
- type Prompt
- func (p *Prompt) EncryptionPassphrase(encryptedData string, initPassphrase string, message string) (string, error)
- func (p *Prompt) Password(label string, message string) (string, error)
- func (p *Prompt) PasswordWithConfirm(label string, message string) (string, error)
- func (p *Prompt) ShowMessage(m string)
- func (p *Prompt) TOTPCode(host, username string, code string, client *c8y.Client, initRequest string) (string, error)
- func (p *Prompt) Username(label string, defaultValue string) (string, error)
- type PromptWithPostValidate
- type Validate
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorPasswordMismatch error when the passwords entered by a user do not match ErrorPasswordMismatch = fmt.Errorf("passwords do not match") ErrorUserCancelled = fmt.Errorf("user cancelled input") )
Functions ¶
This section is empty.
Types ¶
type Prompt ¶
Prompt used to provide various interactive prompts which can be used within the cli
func NewPrompt ¶
NewPrompt returns a new Prompt which can be used to prompt the user for different information
func (*Prompt) EncryptionPassphrase ¶
func (p *Prompt) EncryptionPassphrase(encryptedData string, initPassphrase string, message string) (string, error)
EncryptionPassphrase prompt for the encryption passphrase, and test the passphrase against the encrypted content to see if it is valid
func (*Prompt) PasswordWithConfirm ¶
PasswordWithConfirm prompts the user for a password and confirms it by getting the user to type it in again
func (*Prompt) ShowMessage ¶
type PromptWithPostValidate ¶
type PromptWithPostValidate struct { Attempts int MaxAttempts int PostValidate func(string) error // contains filtered or unexported fields }
func NewPromptWithPostValidate ¶
func NewPromptWithPostValidate(p *promptui.Prompt, validate func(string) error) *PromptWithPostValidate
NewPromptWithPostValidate create a new prompt with a lazy validation function which is only run when the user hits enter.
func (*PromptWithPostValidate) IsUserCancelled ¶
func (p *PromptWithPostValidate) IsUserCancelled(err error) bool
func (*PromptWithPostValidate) Run ¶
func (p *PromptWithPostValidate) Run() (string, error)
Run prompts the user for input
Click to show internal directories.
Click to hide internal directories.