data

package
v6.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	//  Name of the column
	Name string
	// Values for the column
	Values interface{}
}

Column is used by New to specify the columns to create

type Table

type Table struct {
	Frame *data.Frame
}

Table is a convenience structure to create tables to response to SimpleJSON Table Queries

func New

func New(columns ...Column) (table *Table)

New creates a new Table with the specified Column fields

func (Table) Accumulate

func (t Table) Accumulate() *Table

Accumulate creates a new Table where the number values are accumulated over subsequent rows

func (Table) CreateTableResponse

func (t Table) CreateTableResponse() *simplejson.TableResponse

CreateTableResponse creates a simplejson TableResponse from a Dataset

func (Table) DeleteColumn

func (t Table) DeleteColumn(columns ...string) *Table

DeleteColumn returns a table with the listed columns removed

func (Table) Filter

func (t Table) Filter(args simplejson.Args) (filtered *Table)

Filter returns a Dataset meeting the provided query QueryArgs. Currently, it filters based on the args' time Range. only the first time column is taken into consideration.

func (Table) GetColumns

func (t Table) GetColumns() (columns []string)

GetColumns returns the dataset's column names

func (Table) GetFloatValues

func (t Table) GetFloatValues(column string) (values []float64, found bool)

GetFloatValues returns the float64 values for the specified column name. If the column does not exist, found will be false. Will panic if the data in the provided column is of the wrong type.

func (Table) GetStringValues

func (t Table) GetStringValues(column string) (values []string, found bool)

GetStringValues returns the string values for the specified column name. If the column does not exist, found will be false Will panic if the data in the provided column is of the wrong type.

func (Table) GetTimeValues

func (t Table) GetTimeValues(column string) (values []time.Time, found bool)

GetTimeValues returns the time values for the specified column name. If the column does not exist, found will be false. Will panic if the data in the provided column is of the wrong type.

func (Table) GetTimestamps

func (t Table) GetTimestamps() (timestamps []time.Time)

GetTimestamps returns the dataset's timestamps

func (Table) GetValues

func (t Table) GetValues(column string) (values []interface{}, found bool)

GetValues returns the values for the specified column name. If the column does not exist, found will be false

Jump to

Keyboard shortcuts

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