Documentation
¶
Index ¶
- func GetWidthAndHeight() (int, int)
- type Alignment
- type Column
- type Option
- type Table
- type Terminal
- func (t *Terminal) NewTable(percentage float64) *Table
- func (t *Terminal) Prompt(prompt string) (string, error)
- func (t *Terminal) PromptConfirm(prompt string) (bool, error)
- func (t *Terminal) PromptMultipleOptionsSelect(options map[interface{}]string) []Option
- func (t *Terminal) PromptOptionsSelect(options map[interface{}]string) Option
- func (t *Terminal) PromptSelect(prompt string, options []string) (int, string, error)
- func (t *Terminal) SetReader(reader io.Reader)
- func (t *Terminal) SetWriter(writer io.Writer)
- func (t *Terminal) UpdateDimensions()
- type TerminalInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetWidthAndHeight ¶
Types ¶
type Column ¶
type Column struct { Header string // The header text for the column Field string // The field name to extract data from MinWidth int // The minimum width of the column MaxWidth *int // The maximum width of the column Wrap bool // Whether to wrap text in this column Alignment Alignment // The text alignment for this column }
Column represents a single column in a table.
type Table ¶
type Table struct { Columns []Column // The columns of the table Data []map[string]interface{} // The data to be displayed in the table Percentage float64 // The percentage of terminal width to use // contains filtered or unexported fields }
Table represents a table to be rendered in the terminal.
func (*Table) AddColumn ¶
func (t *Table) AddColumn(header, field string, minWidth int, maxWidth *int, wrap bool, alignment Alignment)
AddColumn adds a new column to the table.
type Terminal ¶
type Terminal struct {
// contains filtered or unexported fields
}
func (*Terminal) PromptMultipleOptionsSelect ¶
func (*Terminal) PromptOptionsSelect ¶
func (*Terminal) PromptSelect ¶
func (*Terminal) UpdateDimensions ¶
func (t *Terminal) UpdateDimensions()
Click to show internal directories.
Click to hide internal directories.