input

package module
v0.0.0-...-36e49f2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 8 Imported by: 0

README

go-input

Demo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitTerminal

func InitTerminal() (*term.State, error)

func RestoreTerminal

func RestoreTerminal(state *term.State) error

Types

type Choice

type Choice struct {
	Data   interface{}
	Value  string
	Suffix string
}

type Printer

type Printer struct {
}

func (Printer) BgWhite

func (p Printer) BgWhite(s string) Printer

func (Printer) Blue

func (p Printer) Blue(s string) Printer

func (Printer) ClearLine

func (p Printer) ClearLine() Printer

func (Printer) ClearScreen

func (p Printer) ClearScreen() Printer

func (Printer) CursorRight

func (p Printer) CursorRight(chars int) Printer

func (Printer) CursorStartOfLine

func (p Printer) CursorStartOfLine() Printer

func (Printer) Gray

func (p Printer) Gray(s string) Printer

func (Printer) Green

func (p Printer) Green(s string) Printer

func (Printer) HideCursor

func (p Printer) HideCursor() Printer

func (Printer) NewLine

func (p Printer) NewLine() Printer

func (Printer) Print

func (p Printer) Print(s string) Printer

func (Printer) RestoreCursor

func (p Printer) RestoreCursor() Printer

func (Printer) SaveCursor

func (p Printer) SaveCursor() Printer

func (Printer) ShowCursor

func (p Printer) ShowCursor() Printer

func (Printer) Yellow

func (p Printer) Yellow(s string) Printer

type Selection

type Selection struct {
	Prompt           string
	Choices          []Choice
	PageSize         int
	DefaultSelection string
	ValueFn          func(*Choice) string
	KeyBindings      map[keyboard.Key]func(*Selection, *Choice)
	Footer           string
	// contains filtered or unexported fields
}

func (*Selection) FlashMessage

func (s *Selection) FlashMessage(m string)

func (*Selection) Hide

func (s *Selection) Hide()

func (*Selection) Show

func (s *Selection) Show()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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