query

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FluxColumn

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

FluxColumn holds flux query table column properties

func NewFluxColumn

func NewFluxColumn(index int) *FluxColumn

newFluxColumn creates FluxColumn for position

func NewFluxColumnFull

func NewFluxColumnFull(dataType string, defaultValue string, name string, group bool, index int) *FluxColumn

newFluxColumn creates FluxColumn

func (*FluxColumn) DataType

func (f *FluxColumn) DataType() string

DataType returns data type of the column

func (*FluxColumn) DefaultValue

func (f *FluxColumn) DefaultValue() string

DefaultValue returns default value of the column

func (*FluxColumn) Index

func (f *FluxColumn) Index() int

Index returns index of the column

func (*FluxColumn) IsGroup

func (f *FluxColumn) IsGroup() bool

IsGroup return true if the column is grouping column

func (*FluxColumn) Name

func (f *FluxColumn) Name() string

Name returns name of the column

func (*FluxColumn) SetDataType

func (f *FluxColumn) SetDataType(dataType string)

SetDataType sets data type for the column

func (*FluxColumn) SetDefaultValue

func (f *FluxColumn) SetDefaultValue(defaultValue string)

SetDefaultValue sets default value for the column

func (*FluxColumn) SetGroup

func (f *FluxColumn) SetGroup(group bool)

SetGroup set group flag for the column

func (*FluxColumn) SetName

func (f *FluxColumn) SetName(name string)

SetName sets name of the column

func (*FluxColumn) String

func (f *FluxColumn) String() string

String returns FluxColumn string dump

type FluxRecord

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

FluxRecord represents row in the flux query result table

func NewFluxRecord

func NewFluxRecord(table int, values map[string]interface{}) *FluxRecord

newFluxRecord returns new record for the table with values

func (*FluxRecord) Field

func (r *FluxRecord) Field() string

Field returns the field name

func (*FluxRecord) Measurement

func (r *FluxRecord) Measurement() string

Measurement returns the measurement name of the record

func (*FluxRecord) Start

func (r *FluxRecord) Start() time.Time

Start returns the inclusive lower time bound of all records in the current table

func (*FluxRecord) Stop

func (r *FluxRecord) Stop() time.Time

Stop returns the exclusive upper time bound of all records in the current table

func (*FluxRecord) String

func (r *FluxRecord) String() string

String returns FluxRecord string dump

func (*FluxRecord) Table

func (r *FluxRecord) Table() int

Table returns index of the table record belongs to

func (*FluxRecord) Time

func (r *FluxRecord) Time() time.Time

Start returns the time of the record

func (*FluxRecord) Value

func (r *FluxRecord) Value() interface{}

Value returns the default _value column value or nil if not present

func (*FluxRecord) ValueByKey

func (r *FluxRecord) ValueByKey(key string) interface{}

ValueByKey returns value for given column key for the record or nil of result has no value the column key

func (*FluxRecord) Values

func (r *FluxRecord) Values() map[string]interface{}

Values returns map of the values where key is the column name

type FluxTableMetadata

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

FluxTableMetadata holds flux query result table information represented by collection of columns. Each new table is introduced by annotations

func NewFluxTableMetadata

func NewFluxTableMetadata(position int) *FluxTableMetadata

NewFluxTableMetadata creates FluxTableMetadata for the table on position

func NewFluxTableMetadataFull

func NewFluxTableMetadataFull(position int, columns []*FluxColumn) *FluxTableMetadata

NewFluxTableMetadataFull creates FluxTableMetadata

func (*FluxTableMetadata) AddColumn

func (f *FluxTableMetadata) AddColumn(column *FluxColumn) *FluxTableMetadata

AddColumn adds column definition to table metadata

func (*FluxTableMetadata) Column

func (f *FluxTableMetadata) Column(index int) *FluxColumn

Column returns flux table column by index Returns nil if index is out of the bounds

func (*FluxTableMetadata) Columns

func (f *FluxTableMetadata) Columns() []*FluxColumn

Columns returns slice of flux query result table

func (*FluxTableMetadata) Position

func (f *FluxTableMetadata) Position() int

Position returns position of the table in the flux query result

func (*FluxTableMetadata) String

func (f *FluxTableMetadata) String() string

String returns FluxTableMetadata string dump

Jump to

Keyboard shortcuts

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