dframe

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Nullable

func Nullable(c *Column)

Types

type Column

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

func NewColumn

func NewColumn(name string, options ...ColumnOption) *Column

func (*Column) Add

func (c *Column) Add(vals ...any)

func (*Column) StringSlice

func (c *Column) StringSlice() []string

func (*Column) StringVal

func (c *Column) StringVal(index int) string

type ColumnOption

type ColumnOption func(c *Column)

func WithFormatter

func WithFormatter(formatter StringFormatter) ColumnOption

func WithNilPlaceholder

func WithNilPlaceholder(placeholder string) ColumnOption

type StringFormatter

type StringFormatter func(v any) string

type Table

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

func NewTable

func NewTable(columns ...*Column) (*Table, error)

func (*Table) Append

func (t *Table) Append(c *Column) error

func (*Table) Header

func (t *Table) Header() []string

func (*Table) Limit

func (t *Table) Limit(limit uint) *Table

func (*Table) NumCols

func (t *Table) NumCols() int

func (*Table) NumRows

func (t *Table) NumRows() int

func (*Table) Select

func (t *Table) Select(names ...string) error

func (*Table) StringSlices

func (t *Table) StringSlices() [][]string

Jump to

Keyboard shortcuts

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