tui

package
v0.0.0-...-ecabb92 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInteractiveSelection

func GetInteractiveSelection(title string, items []string) (string, error)

func PromptInteractive

func PromptInteractive(question string, defaultResp bool) (bool, error)

PromptInteractive prompts the user for a yes/no answer, where y or yes is true.

func QuestionInteractive

func QuestionInteractive(question, placeholder string) (string, error)

QuestionInteractive prompts the user for a freeform text response.

func QuestionInteractiveSecret

func QuestionInteractiveSecret(question, placeholder string) (string, error)

Types

type Checklist

type Checklist struct {
	Items []ChecklistItem
	// contains filtered or unexported fields
}

func NewChecklist

func NewChecklist(items []ChecklistItem) *Checklist

func (*Checklist) Init

func (c *Checklist) Init() tea.Cmd

func (*Checklist) SetFailure

func (c *Checklist) SetFailure(index int, message string)

func (*Checklist) SetInconclusive

func (c *Checklist) SetInconclusive(index int, message string)

func (*Checklist) SetRunning

func (c *Checklist) SetRunning(index int)

func (*Checklist) SetSuccess

func (c *Checklist) SetSuccess(index int, message string)

func (*Checklist) Update

func (c *Checklist) Update(msg tea.Msg) (*Checklist, tea.Cmd)

func (*Checklist) View

func (c *Checklist) View() string

type ChecklistItem

type ChecklistItem struct {
	Message string
	State   State
}

type Prompt

type Prompt struct {
	// contains filtered or unexported fields
}

func NewPrompt

func NewPrompt(question string, defaultResp bool) *Prompt

func (Prompt) Init

func (p Prompt) Init() tea.Cmd

func (*Prompt) Update

func (p *Prompt) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Prompt) View

func (p Prompt) View() string

type Question

type Question struct {
	// contains filtered or unexported fields
}

func NewQuestion

func NewQuestion(question string, placeholder string, secret bool) *Question

func (Question) Init

func (q Question) Init() tea.Cmd

func (*Question) Update

func (q *Question) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Question) View

func (q Question) View() string

type Selector

type Selector struct {
	// contains filtered or unexported fields
}

func (Selector) Init

func (s Selector) Init() tea.Cmd

func (*Selector) Update

func (s *Selector) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Selector) View

func (s Selector) View() string

type State

type State int
const (
	StateWaiting State = iota
	StateRunning
	StateSuccess
	StateFailure
	StateInconclusive
)

Jump to

Keyboard shortcuts

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