ask

package
v0.5.1-rc2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PasswordQuestionTemplate = `` /* 473-byte string literal not displayed */

PasswordQuestionTemplate is a template with color formatting. See Documentation: https://github.com/mgutz/ansi#style-format

nolint:lll

Functions

This section is empty.

Types

type Password

type Password struct {
	survey.Renderer

	Default        string
	DefaultDisplay string
	Message        string
	Help           string
}

Password is like a normal Input but the text shows up as *'s and there is no default. Response type is a string.

password := ""
prompt := &survey.Password{ Message: "Please type your password" }
survey.AskOne(prompt, &password)

func (*Password) Cleanup

func (p *Password) Cleanup(config *survey.PromptConfig, val any) error

Cleanup hides the string with a fixed number of characters.

func (*Password) Prompt

func (p *Password) Prompt(config *survey.PromptConfig) (any, error)

func (*Password) Required

func (p *Password) Required(val any) error

Required does not allow an empty value.

type PasswordTemplateData

type PasswordTemplateData struct {
	Password

	ShowHelp bool
	Config   *survey.PromptConfig
}

Jump to

Keyboard shortcuts

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