Versions in this module Expand all Collapse all v0 v0.10.3 Aug 10, 2024 v0.10.2 Aug 10, 2024 v0.10.1 Aug 10, 2024 v0.10.0 Aug 1, 2024 v0.9.0 Aug 1, 2024 Changes in this version + const BGBlack + const BGBlue + const BGCyan + const BGGreen + const BGMagenta + const BGRed + const BGWhite + const BGYellow + const FGBlack + const FGBlue + const FGBold + const FGCyan + const FGFaint + const FGGreen + const FGItalic + const FGMagenta + const FGRed + const FGUnderline + const FGWhite + const FGYellow + const SelectedAdd + var ErrAbort = errors.New("") + var ErrEOF = errors.New("^D") + var ErrInterrupt = errors.New("^C") + var FuncMap = template.FuncMap + var IconBad = Styler(FGRed)("x") — windows/amd64 + var IconBad = Styler(FGRed)("✗") — darwin/amd64, js/wasm, linux/amd64 + var IconGood = Styler(FGGreen)("v") — windows/amd64 + var IconGood = Styler(FGGreen)("✔") — darwin/amd64, js/wasm, linux/amd64 + var IconInitial = Styler(FGBlue)("?") + var IconSelect = Styler(FGBold)(">") — windows/amd64 + var IconSelect = Styler(FGBold)("▸") — darwin/amd64, js/wasm, linux/amd64 + var IconWarn = Styler(FGYellow)("!") — windows/amd64 + var IconWarn = Styler(FGYellow)("⚠") — darwin/amd64, js/wasm, linux/amd64 + var KeyBackspace rune = 8 — windows/amd64 + var KeyBackspace rune = readline.CharBackspace — darwin/amd64, js/wasm, linux/amd64 + var KeyBackward rune = readline.CharBackward + var KeyBackwardDisplay = "←" + var KeyCtrlH rune = readline.CharCtrlH + var KeyEnter rune = readline.CharEnter + var KeyForward rune = readline.CharForward + var KeyForwardDisplay = "→" + var KeyNext rune = readline.CharNext + var KeyNextDisplay = "↓" + var KeyPrev rune = readline.CharPrev + var KeyPrevDisplay = "↑" + var KeySpace rune = 32 + var KeySpaceDisplay = "SPACE" + var ResetCode = fmt.Sprintf("%s%dm", esc, reset) + var SearchPrompt = "Search: " + func Styler(attrs ...attribute) func(interface{}) string + type Cursor struct + Cursor Pointer + Position int + func NewCursor(startinginput string, pointer Pointer, eraseDefault bool) Cursor + func (c *Cursor) Backspace() + func (c *Cursor) End() + func (c *Cursor) Format() string + func (c *Cursor) FormatMask(mask rune) string + func (c *Cursor) Get() string + func (c *Cursor) GetMask(mask rune) string + func (c *Cursor) Listen(line []rune, pos int, key rune) ([]rune, int, bool) + func (c *Cursor) Move(shift int) + func (c *Cursor) Place(position int) + func (c *Cursor) Replace(input string) + func (c *Cursor) Start() + func (c *Cursor) String() string + func (c *Cursor) Update(newinput string) + type Key struct + Code rune + Display string + type Pointer func(to []rune) []rune + var BlockCursor Pointer = blockCursor + var DefaultCursor Pointer = defaultCursor + var PipeCursor Pointer = pipeCursor + type Prompt struct + AllowEdit bool + Default string + HideEntered bool + IsConfirm bool + IsVimMode bool + Label interface{} + LazyValidation bool + Mask rune + Pointer Pointer + Stdin io.ReadCloser + Stdout io.WriteCloser + Templates *PromptTemplates + Validate ValidateFunc + func (p *Prompt) Run() (string, error) + type PromptTemplates struct + Confirm string + FuncMap template.FuncMap + Invalid string + Prompt string + Success string + Valid string + ValidationError string + type Select struct + Checkbox bool + ChosenIcon string + ChosenIndex *[]int + CursorPos int + HideHelp bool + HideSelected bool + IsVimMode bool + Items interface{} + Keys *SelectKeys + Label interface{} + Pointer Pointer + Searcher list.Searcher + Size int + StartInSearchMode bool + Stdin io.ReadCloser + Stdout io.WriteCloser + Templates *SelectTemplates + func (s *Select) Run() (int, string, error) + func (s *Select) RunCursorAt(cursorPos, scroll int) (int, string, error) + func (s *Select) ScrollPosition() int + type SelectKeys struct + Next Key + PageDown Key + PageUp Key + Prev Key + Search Key + Select Key + type SelectTemplates struct + Active string + Details string + FuncMap template.FuncMap + Help string + Inactive string + Label string + Selected string + type SelectWithAdd struct + AddLabel string + HideHelp bool + IsVimMode bool + Items []string + Label string + Pointer Pointer + Validate ValidateFunc + func (sa *SelectWithAdd) Run() (int, string, error) + type ValidateFunc func(string) error