idrf

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package idrf provides the structures for the Outflux Intermediate Data Reperesentation Format. These structures describe data and it's schema. The package also contains functions for safe initialization of the structures

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	DataDef  *DataSet
	DataChan chan Row
}

Bundle defines a bundle of a data definition (schema) and a channel that caries data in IDRF format

type Column

type Column struct {
	Name     string
	DataType DataType
}

Column represents DDL description of a single column in IDRF

func NewColumn

func NewColumn(columnName string, dataType DataType) (*Column, error)

NewColumn creates a new ColumnInfo without a foreign key while checking the arguments

func (Column) String

func (c Column) String() string

type DataSet

type DataSet struct {
	DataSetName string
	Columns     []*Column
	TimeColumn  string
}

DataSet represents DDL description of a single data set (table, measurement) in IDRF

func NewDataSet

func NewDataSet(dataSetName string, columns []*Column, timeColumn string) (*DataSet, error)

NewDataSet creates a new instance of DataSet with checked arguments

func (*DataSet) ColumnNamed

func (set *DataSet) ColumnNamed(columnName string) *Column

ColumnNamed returns the ColumnInfo for a column given it's name, or nil if no column with that name exists in the data set

func (*DataSet) String

func (set *DataSet) String() string

type DataType

type DataType int

DataType Supported data types in the Intermediate Data Representation Format

const (
	IDRFInteger32 DataType = iota + 1
	IDRFInteger64
	IDRFDouble
	IDRFSingle
	IDRFString
	IDRFBoolean
	IDRFTimestamptz
	IDRFTimestamp
	IDRFJson
	IDRFUnknown
)

Available values for IDRF DataType enum

func (DataType) CanFitInto

func (d DataType) CanFitInto(other DataType) bool

CanFitInto returns true if this data type can be safely cast to the other data type

func (DataType) String

func (d DataType) String() string

type Row

type Row []interface{}

Row represents a single row of values in Intermediate Data Representation Format

Jump to

Keyboard shortcuts

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