table

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCol

func NewCol(i int, v string) *col

func NewHeader

func NewHeader(cap int) *header

func NewRow

func NewRow(v []interface{}) *row

func NewTable

func NewTable(cols ...string) data.Table

Types

type Table

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

func (*Table) Append

func (t *Table) Append(values ...interface{})

func (*Table) Col

func (t *Table) Col(i int) data.TableCol

Col returns column information for a zero-indexed table column

func (*Table) Len

func (t *Table) Len() int

func (*Table) Less

func (t *Table) Less(i, j int) bool

func (*Table) OptAscii

func (t *Table) OptAscii(width uint, border string) data.TableOpt

func (*Table) OptCsv

func (t *Table) OptCsv(delim rune) data.TableOpt

func (*Table) OptDuration

func (t *Table) OptDuration(dur time.Duration) data.TableOpt

func (*Table) OptHeader

func (t *Table) OptHeader() data.TableOpt

OptHeader on Read options ensures the first row read is the header for the CSV, on Write ensures the header is output before the first row

func (*Table) OptRowIterator

func (t *Table) OptRowIterator(fn data.IteratorFunc) data.TableOpt

func (*Table) OptSql

func (t *Table) OptSql(name string) data.TableOpt

func (*Table) OptTimezone

func (t *Table) OptTimezone(tz *time.Location) data.TableOpt

func (*Table) OptTransform

func (t *Table) OptTransform(fns ...data.TransformFunc) data.TableOpt

func (*Table) OptType

func (t *Table) OptType(types data.Type) data.TableOpt

func (*Table) Read

func (t *Table) Read(r io.Reader, opts ...data.TableOpt) error

func (*Table) Row

func (t *Table) Row(i int) []interface{}

Row returns values for a zero-indexed table row

func (*Table) Sort

func (t *Table) Sort(fn data.CompareFunc)

Sort does a quicksort on the table using a comparison function

func (*Table) String

func (t *Table) String() string

func (*Table) Swap

func (t *Table) Swap(i, j int)

func (*Table) Write

func (t *Table) Write(w io.Writer, opts ...data.TableOpt) error

Write data with table options

Jump to

Keyboard shortcuts

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