dcon

package module
v0.0.0-...-7af6909 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: Apache-2.0 Imports: 11 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dcon-go

Go сontainer for storing arbitrary data and tables

Build Status Test Status

Usage: https://github.com/n-r-w/dcon-go/blob/main/example/example.go

package main

import (
    "fmt"
    "time"

    "github.com/n-r-w/dcon-go"
)

// Object properties
const (
    id_code = iota
    id_name
    id_slice
    id_date
    id_string_num
    id_string_time
    id_table
)

// strict typing container
const (
    TestStructure = 1
)

// strict typing container properties
const (
    PropertyAny = iota
    PropertyString
    PropertyInteger
    PropertyFloat

    PropertyDataset
    PropertyDatasetColumnAny
    PropertyDatasetColumnString
    PropertyDatasetColumnInteger
    PropertyDatasetColumnFloat
)

func main() {
    // create DataContainer with some properties
    dc, err := dcon.NewDataContainer([]int{id_code, id_name, id_slice, id_string_num, id_string_time, id_date}, []int{id_table})
    if err != nil {
        panic(err)
    }

    // set value
    dc.SetValue(id_code, 123)
    dc.SetValue(id_name, "My name")
    dc.SetValue(id_date, time.Now())
    dc.SetValue(id_string_num, "123456")
    dc.SetValue(id_slice, []int{1, 2, 3})
    dc.SetValue(id_string_time, "2022-05-14T10:03:27.991+03:00")

    // get value with error check
    if v, err := dc.GetValue(id_name); err != nil {
        panic(err)
    } else {
        fmt.Println(v)
    }
    // get value without error check
    fmt.Println(dc.GetVal(id_name))
    fmt.Println(dc.GetVal(id_code))
    fmt.Println(dc.GetVal(id_date))
    fmt.Println(dc.GetVal(id_slice))

    // convert any value to string
    fmt.Println("int => string: ", dc.GetString(id_code))
    fmt.Println("time => string: ", dc.GetString(id_date))

    // convert any value to int
    fmt.Println("string => int: ", dc.GetInt(id_string_num))

    // convert string value to time
    fmt.Println("string => time.Time: ", dc.GetTime(id_string_time))

    // get value as string
    fmt.Println(dcon.CVal[string](dc, id_name))

    // init table: 3 row x 4 column
    table, err := dc.InitTable(id_table, 3, 4)
    if err != nil {
        panic(err)
    }
    // set table value
    table.SetValue(1, 2, 987654)
    table.SetValue(0, 0, time.Now())
    // get value with error check
    if v, err := table.GetValue(1, 2); err != nil {
        panic(err)
    } else {
        fmt.Println(v)
    }
    // get value without error check
    fmt.Println("get value without error check:", table.GetVal(1, 2))

    // get value as int
    fmt.Println("get value as int:", dcon.CDsVal[int](dc, id_table, 1, 2))

    // table to JSON
    fmt.Println("table to JSON:", string(table.ToJSON())) // json.Marshal(table) - also supported

    // container to JSON
    fmt.Println("container to JSON:", string(dc.ToJSON())) // json.Marshal(dc) - also supported

    // table from JSON
    if table2, err := dcon.NewTableJSON(table.ToJSON()); err != nil {
        panic(err)
    } else {
        fmt.Println("table from JSON:", string(table2.ToJSON()))
    }

    // DataContainer from JSON
    if dc2, err := dcon.NewDataContainerJSON(dc.ToJSON()); err != nil {
        panic(err)
    } else {
        fmt.Println("DataContainer from JSON:", string(dc2.ToJSON()))
    }

    // DataContainer extension with strict typing

    // DataStructure factory
    factory := dcon.NewStructureFactory()

    // DataStructure configuration
    config := dcon.StructureConfig{
        ID:      TestStructure,
        Name:    "test structure",
        Version: 1,
        Fields: []dcon.FieldConfig{
            {ID: PropertyAny, DataType: dcon.Any, Name: "PropertyAny"},
            {ID: PropertyString, DataType: dcon.String, Name: "PropertyString"},
            {ID: PropertyInteger, DataType: dcon.Integer, Name: "PropertyInteger"},
            {ID: PropertyFloat, DataType: dcon.Float, Name: "PropertyFloat"},
        },
        Datasets: []dcon.DatasetConfig{
            {
                ID:   PropertyDataset,
                Name: "PropertyDataset",
                Columns: []dcon.ColumnConfig{
                    {ID: PropertyDatasetColumnAny, DataType: dcon.Any, Name: "PropertyDatasetColumnAny"},
                    {ID: PropertyDatasetColumnString, DataType: dcon.String, Name: "PropertyDatasetColumnString"},
                    {ID: PropertyDatasetColumnInteger, DataType: dcon.Integer, Name: "PropertyDatasetColumnInteger"},
                    {ID: PropertyDatasetColumnFloat, DataType: dcon.Float, Name: "PropertyDatasetColumnIntegerFloat"},
                },
            },
        },
    }

    // create new structure from configuration
    structure, err := dcon.NewStructureConf(factory, config)
    if err != nil {
        panic(err)
    }

    // create new container
    scon := dcon.NewStrictContainer(structure)

    scon.SetValue(PropertyAny, "123")
    fmt.Println("PropertyAny: ", scon.GetString(PropertyAny), scon.GetInt(PropertyAny))

    scon.SetValue(PropertyString, 123.456)
    fmt.Println("PropertyString:", scon.GetString(PropertyString), scon.GetFloat(PropertyString))

    scon.AppendRow(PropertyDataset)
    scon.SetCellValue(0, PropertyDatasetColumnString, "12345.678")
    fmt.Println("PropertyDatasetColumnString:", scon.GetCellString(0, PropertyDatasetColumnString), scon.GetCellFloat(0, PropertyDatasetColumnString))

    sameStructure := factory.Get(TestStructure)
    fmt.Println("sameStructure:", sameStructure.Name())

    // container to JSON
    fmt.Println("StrictContainer to JSON:", string(scon.ToJSON())) // json.Marshal(scon) - also supported
}

Documentation

Overview

Package dcon - universal data container for any values and tables

Index

Constants

View Source
const PropertyIDUnefined = PropertyID(0)

PropertyIDUnefined ...

Variables

This section is empty.

Functions

func CDsVal

func CDsVal[T any](c *DataContainer, id int, row int, column int) T

CDsVal - generic helper for read table value from DataContainer. Errors ignored

func CDsValue

func CDsValue[T any](c *DataContainer, id int, row int, column int) (T, error)

CDsValue - generic helper for read table value from DataContainer

func CVal

func CVal[T any](c *DataContainer, id int) T

CVal - generic helper for read value from DataContainer. Errors ignored

func CValue

func CValue[T any](c *DataContainer, id int) (T, error)

CValue - generic helper for read value from DataContainer

func DsVal

func DsVal[T any](table *Table, row int, column int) T

DsVal - generic table value getter with type conversion. Errors ignored

func DsValue

func DsValue[T any](table *Table, row int, column int) (T, error)

DsValue - generic table value getter with type conversion

Types

type ColumnConfig

type ColumnConfig struct {
	ID       PropertyID
	DataType DataType
	Name     string
}

type ContainerReadWriter

type ContainerReadWriter interface {
	ContainerReader
	ContainerWriter
}

ContainerReadWriter - read and write interface for container

type ContainerReader

type ContainerReader interface {
	StructureInformer

	GetInt(id PropertyID) int64
	GetFloat(id PropertyID) float64
	GetString(id PropertyID) string
	GetByteArray(id PropertyID) []byte
	GetAny(id PropertyID) interface{}
	IsEmpty(id PropertyID) bool

	GetCellInt(row int, columnID PropertyID) int64
	GetCellFloat(row int, columnID PropertyID) float64
	GetCellString(row int, columnID PropertyID) string
	GetCellByteArray(row int, columnID PropertyID) []byte
	GetCellAny(row int, columnID PropertyID) interface{}
	IsCellEmpty(row int, columnID PropertyID) bool
	RowCount(datasetID PropertyID) int
	ColumnCount(datasetID PropertyID) int
	ColumnFromPos(datasetID PropertyID, pos int) (PropertyID, error)
}

ContainerReader - interface for reading from container

type ContainerWriter

type ContainerWriter interface {
	StructureInformer

	SetValue(id PropertyID, v interface{}) error
	Trim(id PropertyID) error
	Clear(id PropertyID) error

	SetCellValue(row int, columnID PropertyID, v interface{}) error
	TrimCell(row int, columnID PropertyID) error
	ClearCell(row int, columnID PropertyID) error
	AppendRow(datasetID PropertyID) error
	InsertRow(datasetID PropertyID, pos int) error
}

ContainerWriter - interface for writing to container

type DataContainer

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

DataContainer - container of any data. Access by field ID

func NewDataContainer

func NewDataContainer(valueIDs []int, tableIDs []int) (*DataContainer, error)
NewDataContainer - create DataContainer

valueIDs: ID of general fields, tableIDs: ID of tables

func NewDataContainerJSON

func NewDataContainerJSON(data []byte) (*DataContainer, error)

NewDataContainerJSON - create DataContainer from JSON

func (*DataContainer) AppendRow

func (d *DataContainer) AppendRow(id int) error

AppendRow - append row to the end of table

func (*DataContainer) Clear

func (d *DataContainer) Clear(id int) error

Clear field or table

func (*DataContainer) Clone

func (d *DataContainer) Clone() *DataContainer

Clone - clone DataContainer

func (*DataContainer) Contains

func (d *DataContainer) Contains(id int) bool

Contains - contains id property

func (*DataContainer) Debug

func (d *DataContainer) Debug() string

Debug - show debug info

func (*DataContainer) FromJSON

func (d *DataContainer) FromJSON(data []byte) error

ToJSON - export to JSON

func (*DataContainer) GetFloat32

func (d *DataContainer) GetFloat32(id int) float32

GetInt - get object value by ID. Convert to int if it possible

func (*DataContainer) GetFloat64

func (d *DataContainer) GetFloat64(id int) float64

GetInt64 - get object value by ID. Convert to int64 if it possible

func (*DataContainer) GetInt

func (d *DataContainer) GetInt(id int) int

GetInt - get object value by ID. Convert to int if it possible

func (*DataContainer) GetInt64

func (d *DataContainer) GetInt64(id int) int64

GetInt64 - get object value by ID. Convert to int64 if it possible

func (*DataContainer) GetString

func (d *DataContainer) GetString(id int) string

GetString - get object value by ID. Convert to string if it possible

func (*DataContainer) GetTableFloat32

func (d *DataContainer) GetTableFloat32(id int, row int, column int) float32

GetTableInt - get table value by ID. Convert to int if it possible

func (*DataContainer) GetTableFloat64

func (d *DataContainer) GetTableFloat64(id int, row int, column int) float64

GetTableInt64 - get table value by ID. Convert to int64 if it possible

func (*DataContainer) GetTableInt

func (d *DataContainer) GetTableInt(id int, row int, column int) int

GetTableInt - get table value by ID. Convert to int if it possible

func (*DataContainer) GetTableInt64

func (d *DataContainer) GetTableInt64(id int, row int, column int) int64

GetTableInt64 - get table value by ID. Convert to int64 if it possible

func (*DataContainer) GetTableString

func (d *DataContainer) GetTableString(id int, row int, column int) string

GetTableString - get table value by ID. Convert to string if it possible

func (*DataContainer) GetTableTime

func (d *DataContainer) GetTableTime(id int, row int, column int) time.Time

GetTableTime - get table value by ID. Convert to time if it possible

func (*DataContainer) GetTableVal

func (d *DataContainer) GetTableVal(id int, row int, column int) interface{}

GetTableVal - get table value by ID. Errors ignored

func (*DataContainer) GetTableValue

func (d *DataContainer) GetTableValue(id int, row int, column int) (interface{}, error)

GetTableValue - get table value by ID

func (*DataContainer) GetTime

func (d *DataContainer) GetTime(id int) time.Time

GetTime - get object value by ID. Convert to time if it possible

func (*DataContainer) GetVal

func (d *DataContainer) GetVal(id int) interface{}

GetVal - get object value by ID. Errors ignored

func (*DataContainer) GetValue

func (d *DataContainer) GetValue(id int) (interface{}, error)

GetValue - get object value by ID

func (*DataContainer) InitTable

func (d *DataContainer) InitTable(id int, rowCount int, columnCount int) (*Table, error)

InitTable - table initialization

func (*DataContainer) InsertRow

func (d *DataContainer) InsertRow(id int, pos int) error

InsertRow - insert row to position. pos == 0 => insert to first row, pos == RowCount => insert to the end

func (*DataContainer) IsTable

func (d *DataContainer) IsTable(id int) bool

IsTable - check is property is table (not value)

func (*DataContainer) IsValue

func (d *DataContainer) IsValue(id int) bool

IsValue - check is property is value (not table)

func (*DataContainer) MarshalJSON

func (d *DataContainer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*DataContainer) Properties

func (d *DataContainer) Properties() (values []int, tables []int)

Properties - return all properties ID

func (*DataContainer) Reset

func (d *DataContainer) Reset()

Reset - reset all data to empty

func (*DataContainer) SetTableValue

func (d *DataContainer) SetTableValue(id int, row int, column int, value interface{}) error

SetTableValue - write table value by ID

func (*DataContainer) SetTimeFormat

func (d *DataContainer) SetTimeFormat(f string)

SetTimeFormat - set format string fo GetString function

func (*DataContainer) SetValue

func (d *DataContainer) SetValue(id int, value interface{}) error

SetValue - write object value by ID

func (*DataContainer) Table

func (d *DataContainer) Table(id int) (*Table, error)

Table - get Table object by ID

func (*DataContainer) ToFile

func (d *DataContainer) ToFile(fname string, perm os.FileMode) error

ToFile - export to file

func (*DataContainer) ToJSON

func (d *DataContainer) ToJSON() []byte

ToJSON - export to JSON

func (*DataContainer) Trim

func (d *DataContainer) Trim(id int) error

func (*DataContainer) UnmarshalJSON

func (d *DataContainer) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

func (*DataContainer) Validate

func (d *DataContainer) Validate(names map[int]string, rules map[int][]validation.Rule) error

Validate - data validation

type DataType

type DataType uint8

DataType ...

const (
	Integer   DataType = 1
	Float     DataType = 2
	String    DataType = 3
	ByteArray DataType = 4
	Any       DataType = 5
	TableType DataType = 6
)

type DatasetConfig

type DatasetConfig struct {
	ID      PropertyID
	Name    string
	Columns []ColumnConfig
}

type Entity

type Entity[T EntityID] struct {
	// contains filtered or unexported fields
}

Entity - an object with a specified data structure and a unique identifier

func MakeEntity

func MakeEntity[T EntityID](data *StrictContainer, id T) *Entity[T]

func NewEntity

func NewEntity[T EntityID](factory *StructureFactory, structureID StructureID, id T) (*Entity[T], error)

NewEntity - create new Entity

func (*Entity[T]) Data

func (e *Entity[T]) Data() *StrictContainer

Data - object data

func (*Entity[T]) ID

func (e *Entity[T]) ID() T

ID - unique object ID

func (*Entity[T]) SetID

func (e *Entity[T]) SetID(id T)

SetID - change oject ID

type EntityID

type EntityID interface {
	~uint64 | ~string
}

EntityID - unique object ID

type FieldConfig

type FieldConfig struct {
	ID       PropertyID
	DataType DataType
	Name     string
}

type Property

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

Property ...

func NewDatasetProperty

func NewDatasetProperty(
	id PropertyID,
	name string,
	columns []Property) (Property, error)

func NewFieldProperty

func NewFieldProperty(
	id PropertyID,
	dataType DataType,
	name string) (Property, error)

func (*Property) DataType

func (p *Property) DataType() DataType

func (*Property) ID

func (p *Property) ID() PropertyID

func (*Property) Name

func (p *Property) Name() string

func (*Property) PropertyType

func (p *Property) PropertyType() PropertyType

type PropertyID

type PropertyID uint16

PropertyID ...

type PropertyType

type PropertyType uint8

PropertyType ...

const (
	Field   PropertyType = 1
	Dataset PropertyType = 2
)

type StrictContainer

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

StrictContainer ...

func NewStrictContainer

func NewStrictContainer(structure *Structure) *StrictContainer

NewStrictContainer ...

func (*StrictContainer) AppendRow

func (sc *StrictContainer) AppendRow(datasetID PropertyID) error

func (*StrictContainer) Clear

func (sc *StrictContainer) Clear(id PropertyID) error

func (*StrictContainer) ClearCell

func (sc *StrictContainer) ClearCell(row int, columnID PropertyID) error

func (*StrictContainer) ColumnCount

func (sc *StrictContainer) ColumnCount(datasetID PropertyID) int

func (*StrictContainer) ColumnFromPos

func (sc *StrictContainer) ColumnFromPos(datasetID PropertyID, pos int) (PropertyID, error)

ColumnFromPos - convert column position to PropertyID

func (*StrictContainer) ContainsProperty

func (sc *StrictContainer) ContainsProperty(id PropertyID) bool

func (*StrictContainer) DatasetByColumn

func (sc *StrictContainer) DatasetByColumn(columnID PropertyID) (PropertyID, error)

func (*StrictContainer) DatasetColumns

func (sc *StrictContainer) DatasetColumns(datasetID PropertyID) ([]PropertyID, error)

func (*StrictContainer) DatasetColumnsProperty

func (sc *StrictContainer) DatasetColumnsProperty(datasetID PropertyID) ([]Property, error)

func (*StrictContainer) GetAny

func (sc *StrictContainer) GetAny(id PropertyID) interface{}

func (*StrictContainer) GetByteArray

func (sc *StrictContainer) GetByteArray(id PropertyID) []byte

func (*StrictContainer) GetCellAny

func (sc *StrictContainer) GetCellAny(row int, columnID PropertyID) interface{}

func (*StrictContainer) GetCellByteArray

func (sc *StrictContainer) GetCellByteArray(row int, columnID PropertyID) []byte

func (*StrictContainer) GetCellFloat

func (sc *StrictContainer) GetCellFloat(row int, columnID PropertyID) float64

func (*StrictContainer) GetCellInt

func (sc *StrictContainer) GetCellInt(row int, columnID PropertyID) int64

func (*StrictContainer) GetCellString

func (sc *StrictContainer) GetCellString(row int, columnID PropertyID) string

func (*StrictContainer) GetFloat

func (sc *StrictContainer) GetFloat(id PropertyID) float64

func (*StrictContainer) GetInt

func (sc *StrictContainer) GetInt(id PropertyID) int64

func (*StrictContainer) GetString

func (sc *StrictContainer) GetString(id PropertyID) string

func (*StrictContainer) InsertRow

func (sc *StrictContainer) InsertRow(datasetID PropertyID, pos int) error

func (*StrictContainer) IsCellEmpty

func (sc *StrictContainer) IsCellEmpty(row int, columnID PropertyID) bool

func (*StrictContainer) IsEmpty

func (sc *StrictContainer) IsEmpty(id PropertyID) bool

func (*StrictContainer) MarshalJSON

func (sc *StrictContainer) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*StrictContainer) Properties

func (sc *StrictContainer) Properties() []Property

func (*StrictContainer) Property

func (sc *StrictContainer) Property(id PropertyID) (Property, bool)

func (*StrictContainer) RawData

func (sc *StrictContainer) RawData() *DataContainer

func (*StrictContainer) RowCount

func (sc *StrictContainer) RowCount(datasetID PropertyID) int

func (*StrictContainer) SetCellValue

func (sc *StrictContainer) SetCellValue(row int, columnID PropertyID, v interface{}) error

func (*StrictContainer) SetValue

func (sc *StrictContainer) SetValue(id PropertyID, v interface{}) error

func (*StrictContainer) StructID

func (sc *StrictContainer) StructID() StructureID

func (*StrictContainer) StructName

func (sc *StrictContainer) StructName() string

func (*StrictContainer) Structure

func (sc *StrictContainer) Structure() *Structure

func (*StrictContainer) ToFile

func (sc *StrictContainer) ToFile(fname string, perm os.FileMode) error

ToFile - export to file

func (*StrictContainer) ToJSON

func (sc *StrictContainer) ToJSON() []byte

ToJSON - export to JSON

func (*StrictContainer) Trim

func (sc *StrictContainer) Trim(id PropertyID) error

func (*StrictContainer) TrimCell

func (sc *StrictContainer) TrimCell(row int, columnID PropertyID) error

func (*StrictContainer) Validate

func (sc *StrictContainer) Validate(rules map[PropertyID][]validation.Rule) error

Validate - data validation

type Structure

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

Structure ...

func NewStructure

func NewStructure(factory *StructureFactory, id StructureID, name string, properties []Property) (*Structure, error)

func NewStructureConf

func NewStructureConf(factory *StructureFactory, conf StructureConfig) (*Structure, error)

func (*Structure) Contains

func (sc *Structure) Contains(id PropertyID) bool

func (*Structure) DatasetByColumn

func (sc *Structure) DatasetByColumn(columnID PropertyID) (PropertyID, error)

func (*Structure) DatasetColumns

func (sc *Structure) DatasetColumns(datasetID PropertyID) ([]PropertyID, error)

func (*Structure) DatasetColumnsProperty

func (sc *Structure) DatasetColumnsProperty(datasetID PropertyID) ([]Property, error)

func (*Structure) ID

func (sc *Structure) ID() StructureID

func (*Structure) Name

func (sc *Structure) Name() string

func (*Structure) Properties

func (sc *Structure) Properties() []Property

func (*Structure) Property

func (sc *Structure) Property(id PropertyID) (Property, bool)

type StructureConfig

type StructureConfig struct {
	ID       StructureID
	Name     string
	Version  uint16
	Fields   []FieldConfig
	Datasets []DatasetConfig
}

type StructureFactory

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

func NewStructureFactory

func NewStructureFactory() *StructureFactory

func (*StructureFactory) Get

func (sf *StructureFactory) Get(id StructureID) *Structure

type StructureID

type StructureID uint16

type StructureInformer

type StructureInformer interface {
	StructID() StructureID
	StructName() string
	Properties() []Property
	Property(id PropertyID) (Property, bool)
	ContainsProperty(id PropertyID) bool
	DatasetColumns(datasetID PropertyID) ([]PropertyID, error)
	DatasetColumnsProperty(datasetID PropertyID) ([]Property, error)
	DatasetByColumn(columnID PropertyID) (PropertyID, error)
}

StructureInformer - information about data structure

type Table

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

Table - table with any data

func NewTable

func NewTable(rowCount int, columnCount int) *Table

NewTable - create Table object

func NewTableJSON

func NewTableJSON(data []byte) (*Table, error)

NewTableJSON - create Table object from JSON

func (*Table) AppendRow

func (d *Table) AppendRow()

AppendRow - append row to the end of table

func (*Table) Clear

func (d *Table) Clear()

Clear - reset all data to empty

func (*Table) Clone

func (d *Table) Clone() *Table

Clone - clone Table object

func (*Table) ColumnCount

func (d *Table) ColumnCount() int

ColumnCount - column count

func (*Table) Debug

func (d *Table) Debug() string

Debug - show debug info

func (*Table) FromJSON

func (d *Table) FromJSON(data []byte) error

ToJSON - convert to JSON

func (*Table) GetVal

func (d *Table) GetVal(row int, column int) interface{}

GetVal - get value for row and column. No error check

func (*Table) GetValue

func (d *Table) GetValue(row int, column int) (interface{}, error)

GetValue - get value for row and column

func (*Table) InsertRow

func (d *Table) InsertRow(pos int) error

InsertRow - insert row to position. pos == 0 => insert to first row, pos == RowCount => insert to the end

func (*Table) MarshalJSON

func (d *Table) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*Table) RowCount

func (d *Table) RowCount() int

RowCount - row count

func (*Table) SetColumnCount

func (d *Table) SetColumnCount(n int) error

SetColumnCount - set column count

func (*Table) SetDim

func (d *Table) SetDim(rowCount int, columnCount int) error

SetDim - set row and column count

func (*Table) SetRowCount

func (d *Table) SetRowCount(n int) error

SetRowCount - set row count

func (*Table) SetValue

func (d *Table) SetValue(row int, column int, value interface{}) error

SetValue - set value for row and column

func (*Table) ToJSON

func (d *Table) ToJSON() []byte

ToJSON - convert to JSON

func (*Table) UnmarshalJSON

func (d *Table) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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