timeseries

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParquetRow added in v1.0.0

func GetParquetRow(pkg *common.DataRecord) parquetrow.ParquetRow

GetParquetRow returns the exportable parquet representation of a record, including common attributes

func ParquetName added in v1.0.0

func ParquetName(pkg *common.DataRecord, stream OutStream) string

ParquetName returns the whole name of the parquet, including partitioning prefix

Types

type CSV

type CSV struct {
	Name     string
	HasSpec  bool
	HasHead  bool
	NHeaders int
	// contains filtered or unexported fields
}

CSV gives easy access for csv writing

func (*CSV) Close

func (csv *CSV) Close()

Close flushes and closes underlying file if any

func (*CSV) SetHeaderRow

func (csv *CSV) SetHeaderRow(columns []string) error

SetHeaderRow writes header, only allows once and if specifications previously written

func (*CSV) SetSpecifications

func (csv *CSV) SetSpecifications(specs []string) error

SetSpecifications writes specifications, only allows once

func (*CSV) WriteData

func (csv *CSV) WriteData(data []string) error

WriteData writes a data row, only allows if headers have been written

type CSVCollection

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

CSVCollection hold all active csv writers

func NewCollection

func NewCollection(factory CSVFactory) CSVCollection

NewCollection returns a novel ready to use CSVCollection

func (*CSVCollection) CloseAll

func (collection *CSVCollection) CloseAll()

CloseAll closes all open streams

func (*CSVCollection) Write

func (collection *CSVCollection) Write(pkg *common.DataRecord) error

Write adds a csv row into the relevant out stream

type CSVFactory

type CSVFactory func(pkg *common.DataRecord, stream OutStream) (CSVWriter, error)

CSVFactory is a function that creates CSVWriters

type CSVWriter

type CSVWriter interface {
	Close()
	SetSpecifications(specs []string) error
	SetHeaderRow(columns []string) error
	WriteData(data []string) error
}

CSVWriter implements ease of use writing functions

func NewCSV

func NewCSV(out io.Writer, name string) CSVWriter

NewCSV returns a Timeseries CSV

type OutStream

type OutStream int

OutStream is the type for the outstream enum

const (
	// Unknown is an unregonized out stream
	Unknown OutStream = iota
	// HTR is a HTR timeseries out stream
	HTR
	// PWR is a PWR timeseries out stream
	PWR
	// CPRU is a CPRU timeseries out stream
	CPRU
	// STAT is as STAT timeseries out stream
	STAT
	// PM is a PM timeseries out stream
	PM
	// CCD is a CCD timeseries out stream
	CCD
	// TCV is a TCV timeseries out stream
	TCV
)

func OutStreamFromDataRecord

func OutStreamFromDataRecord(pkg *common.DataRecord) OutStream

OutStreamFromDataRecord infers stream based on data

func (OutStream) String

func (stream OutStream) String() string

type Parquet added in v1.0.0

type Parquet struct {
	Name     string
	NHeaders int
	// contains filtered or unexported fields
}

Parquet gives easy access for parquet writing

func (*Parquet) Close added in v1.0.0

func (parquet *Parquet) Close()

Close flushes and closes underlying file if any

func (*Parquet) WriteData added in v1.0.0

func (parquet *Parquet) WriteData(data interface{}) error

WriteData writes a data row

type ParquetCollection added in v1.0.0

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

ParquetCollection holds all active ParquetWriters

func NewParquetCollection added in v1.0.0

func NewParquetCollection(factory ParquetFactory) ParquetCollection

NewParquetCollection returns a novel ready to use ParquetCollection

func (*ParquetCollection) CloseAll added in v1.0.0

func (collection *ParquetCollection) CloseAll()

CloseAll closes all open streams

func (ParquetCollection) Write added in v1.0.0

func (collection ParquetCollection) Write(pkg *common.DataRecord) error

Write adds a parquet row into the relevant out stream

type ParquetFactory added in v1.0.0

type ParquetFactory func(pkg *common.DataRecord, stream OutStream) (ParquetWriter, error)

ParquetFactory is a function that creates ParquetWriters

type ParquetWriter added in v1.0.0

type ParquetWriter interface {
	Close()
	WriteData(data interface{}) error
}

ParquetWriter implements ease of use writing functions

func NewParquet added in v1.0.0

func NewParquet(name string, pkg *common.DataRecord) ParquetWriter

NewParquet returns a Timeseries as parquet

Jump to

Keyboard shortcuts

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