table

package
v1.8.16 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	ID        string
	Name      string
	SortIndex int
	Width     int
}

type Table

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

func NewTable

func NewTable(theme Theme, opts TableOptions, ascii bool) *Table

func (*Table) AddRow

func (t *Table) AddRow(row []interface{})

func (*Table) Render

func (t *Table) Render()

func (*Table) SetCols

func (t *Table) SetCols(cols []Column)

func (*Table) SetTitle

func (t *Table) SetTitle(title string)

type TableOptions

type TableOptions struct {
	Columns []int
	SortBy  int
	Style   table.Style
}

type Theme

type Theme struct {
	ColorRed     termenv.Color
	ColorYellow  termenv.Color
	ColorGreen   termenv.Color
	ColorBlue    termenv.Color
	ColorGray    termenv.Color
	ColorViolet  termenv.Color
	ColorMagenta termenv.Color
	ColorCyan    termenv.Color
}

Theme defines a color theme used for printing tables.

func LoadTheme

func LoadTheme(theme string) (Theme, error)

Jump to

Keyboard shortcuts

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