table

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: Unlicense Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Row added in v1.0.1

type Row = []string

type Rows added in v1.0.1

type Rows = []Row

type Table

type Table interface {
	// Load loads a table from a csv file
	Load(filename string) error
	// Save saves a table to a csv file
	Save(filename string) error
	// Fields returns the fields of the table
	Fields() Row
	// Rows returns the rows of the table
	Rows() Rows
	// SetFields sets the fields of the table
	SetFields(fields Row)
	// SetRows sets the rows of the table
	SetRows(rows Rows)
	// FieldIndex returns the index of a field, or -1 if it doesn't exist
	FieldIndex(field string) int
	// AppendRows appends rows to the table
	AppendRows(rows ...Row)
	// Sort sorts the table by a field
	Sort(field string) error
	// SortFunc sorts the table by a function
	SortFunc(func(row1, row2 Row) int)
}

func New

func New() Table

Jump to

Keyboard shortcuts

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