Documentation ¶
Overview ¶
Package csv-table provides a tool to view csv files on the cmdline.
┌──┬──┐ │ │ │ ├──┼──┤ └──┴──┘
Index ¶
- Variables
- func CSVRowIterator(reader io.Reader) <-chan Row
- func FprintfTable(w io.Writer, config TableConfig, t Table, tableInfo TableInfo) error
- func PrintCSVTable(r io.Reader) error
- func PrintSimpleTable(data [][]string) error
- func SimpleRowIterator(data [][]string) <-chan Row
- type CSVTable
- type Row
- type SimpleTable
- type Table
- type TableConfig
- type TableInfo
Constants ¶
This section is empty.
Variables ¶
Logger - Default *log.Logger variable. Set output to os.Stderr or override.
Functions ¶
func FprintfTable ¶
FprintfTable -
func PrintCSVTable ¶
PrintCSVTable - Given an io.Reader that points to CSV content, it prints the CSV as a table.
Types ¶
type CSVTable ¶
CSVTable -
func (CSVTable) RowIterator ¶
RowIterator - Implements the Table interface.
type SimpleTable ¶
type SimpleTable struct {
Data [][]string
}
SimpleTable - A basic structure that implements the Table interface.
func (SimpleTable) RowIterator ¶
func (t SimpleTable) RowIterator() <-chan Row
RowIterator - Implements the Table interface.
type Table ¶
type Table interface {
RowIterator() <-chan Row
}
Table - interface used to print a table
type TableConfig ¶
type TableConfig struct { HeaderStart string HeaderEnd string HeaderJuncture string Body string Column string LineStart string LineEnd string LineJuncture string LineBetweenRows bool ColumnEdges bool }
TableConfig -
func NewDefaultTableConfig ¶
func NewDefaultTableConfig(columnEdges, lineBetweenRows bool) TableConfig
NewDefaultTableConfig -
type TableInfo ¶
type TableInfo struct { Columns int Rows int PerRowColumnWidths [][]int // Number of Lines in a Row due to multiline entries. PerRowRows [][]int ColumnWidths []int RowHeights []int }
TableInfo - Table information
func GetTableInfo ¶
GetTableInfo - Iterates over all the elements of the table to get number of Colums, Colum widths, etc.
Click to show internal directories.
Click to hide internal directories.