table

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name    string `json:"name"`
	Default string `json:"default"`
	Type    string `json:"type"`
}

type Table

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

func (*Table) AddColumn

func (t *Table) AddColumn(value Column) error

func (*Table) AddRow

func (t *Table) AddRow(value map[string]any) error

func (*Table) DeleteColumn

func (t *Table) DeleteColumn(name string) error

func (*Table) DeleteRow

func (t *Table) DeleteRow(index int) error

func (*Table) GetColumn

func (t *Table) GetColumn(name string) (Column, error)

func (*Table) GetColumns

func (t *Table) GetColumns() []Column

func (*Table) GetRow

func (t *Table) GetRow(index int) (map[string]any, error)

func (*Table) GetRows

func (t *Table) GetRows() []map[string]any

func (*Table) SetColumnDefault

func (t *Table) SetColumnDefault(name string, value string) error

func (*Table) SetColumnName

func (t *Table) SetColumnName(name string, value string) error

func (*Table) SetRow

func (t *Table) SetRow(index int, value map[string]any) error

func (*Table) ToU

func (t *Table) ToU() TableU

ToU - table to tableU

type TableU

type TableU struct {
	Columns []Column         `json:"columns"`
	Rows    []map[string]any `json:"rows"`
}

func (*TableU) FromJ

func (t *TableU) FromJ(in []byte) error

FromJ json to tableU

func (*TableU) ToJ

func (t *TableU) ToJ() ([]byte, error)

ToJ tableU to json

func (*TableU) ToT

func (t *TableU) ToT() (Table, error)

ToT tableU to table

Jump to

Keyboard shortcuts

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