backend

package
v0.0.0-...-da1d25d Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewColumnarBackend

func NewColumnarBackend(headers Headers) *columnarBackend

Types

type ApplyFunction

type ApplyFunction func(value types.TypedValue) types.TypedValue

type Backend

type Backend interface {
	GetHeaders() Headers
	GetRowCount() int
	GetRow(id int) Row
	AppendRow(row ...Row)
	ForEachRow(visitor RowVisitor)
	ForEachColumn(visitor ColumnVisitor)
	AddColumn(name string, kind types.TypeKind, mutateFn MutateFunction)
	UpdateColumn(name string, mutateFn MutateFunction)
	RemoveRows(ids ...int)
	RemoveColumn(name string)
	RenameColumn(old string, new string)
	SortByColumn(column string, order Ordering)
	ConstructNew(headers Headers) Backend
	SetColumns(columns Columns)
	CastColumn(name string, toKind types.TypeKind)
	ApplyOnColumn(name string, fn ApplyFunction)
}

func New

func New(headers Headers) Backend

type Cell

type Cell struct {
	types.TypedValue
	// contains filtered or unexported fields
}

type Column

type Column []Cell

type ColumnVisitor

type ColumnVisitor func(header string, values Column)

type Columns

type Columns map[string]Column

func (*Columns) GetHeaders

func (c *Columns) GetHeaders() Headers
type Header struct {
	Name    string
	Kind    types.TypeKind
	Visible bool
}

type Headers

type Headers []Header

type MutateFunction

type MutateFunction func(id int, row Row) types.TypedValue

type Ordering

type Ordering bool
const (
	Asc  Ordering = true
	Desc Ordering = false
)

type Row

type Row map[string]types.TypedValue

type RowVisitor

type RowVisitor func(id int, row Row)

Jump to

Keyboard shortcuts

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