draw

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

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

Table is a table that can be drawn.

func NewTable

func NewTable(ctx context.Context, d TableData) (*Table, error)

NewTable creates a new table.

func (*Table) DrawTable

func (t *Table) DrawTable() error

DrawTable should be called to draw the table.

func (Table) Init

func (t Table) Init() tea.Cmd

Init implements tea.Model.Init. Should not be called directly.

func (Table) Update

func (t Table) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.Update. Should not be called directly.

func (Table) View

func (t Table) View() string

View implements tea.Model.View. Should not be called directly.

type TableData

type TableData interface {
	// Columns returns the columns of the table.
	Columns() []table.Column

	// Rows returns the rows of the table.
	Rows(ctx context.Context) ([]table.Row, error)

	// Selected is called when a row is selected.
	// The entire row is passed to the function.
	Selected(table.Row) error
}

TableData is the data for a table.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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