tui

package module
v0.0.0-...-9bb1661 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 8 Imported by: 0

README

Rubber Duck TUI

A reuseable TUI component for rubber duck.

Features

  • A standard theme
  • Multiple-Selection List
  • ...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Default

type Default struct {
}

func (Default) Title

func (t Default) Title(s string) string

type PrettyList

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

func NewPrettyList

func NewPrettyList(items []string) PrettyList

func (PrettyList) Print

func (l PrettyList) Print()

type PrettyTable

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

func NewPrettyTable

func NewPrettyTable(title string, headers []string, rows [][]string) PrettyTable

func (*PrettyTable) Print

func (t *PrettyTable) Print()

func (*PrettyTable) SetAutoIndex

func (t *PrettyTable) SetAutoIndex(autoIndex bool)

func (*PrettyTable) SetFilter

func (t *PrettyTable) SetFilter(filter PrettyTableFilter)

func (*PrettyTable) Write

func (t *PrettyTable) Write(wr io.StringWriter)

type PrettyTableFilter

type PrettyTableFilter struct {
	Key        string `help:"filter target key (column)"`
	Value      string `help:"filter target value"`
	FizzyMatch bool   `default:"true" help:"enable fizzy match on value"`

	SortedBy []string `help:"sort keys"`
	Show     []string `help:"show specific columns"`
	Hide     []string `help:"hide specific columns"`
}

type SelectionModel

type SelectionModel[T any] struct {
	// contains filtered or unexported fields
}

func NewSelection

func NewSelection[T any](title string, options []T, getlabel func(T) string) *SelectionModel[T]

func NewStringSelection

func NewStringSelection(title string, options []string) *SelectionModel[string]

func (*SelectionModel[T]) GetSelected

func (m *SelectionModel[T]) GetSelected() []T

func (*SelectionModel[T]) Init

func (m *SelectionModel[T]) Init() tea.Cmd

func (*SelectionModel[T]) SetAutoclear

func (m *SelectionModel[T]) SetAutoclear()

func (*SelectionModel[T]) SetSingleMode

func (m *SelectionModel[T]) SetSingleMode()

func (*SelectionModel[T]) Start

func (m *SelectionModel[T]) Start() error

func (*SelectionModel[T]) Update

func (m *SelectionModel[T]) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*SelectionModel[T]) View

func (m *SelectionModel[T]) View() string

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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