Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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) SetHeaderRow ¶
SetHeaderRow writes header, only allows once and if specifications previously written
func (*CSV) SetSpecifications ¶
SetSpecifications writes specifications, only allows once
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
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
Click to show internal directories.
Click to hide internal directories.