bytestreams

package
v0.0.0-...-5e0ed37 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

* Copyright (c) 2015 The heedy Contributors (see AUTHORS) Licensed under the MIT license. *

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type CSVDatapointReader

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

CSVDatapointReader is a reader for CSV files

func NewCSVDatapointReader

func NewCSVDatapointReader(r io.Reader, timestamphint string, disabletimestamp bool) (*CSVDatapointReader, error)

NewCSVDatapointReader creates a new reader for CSV files, using the optional timestamp key hint and optional disabling of timestamp

func (*CSVDatapointReader) Next

Next allows us to conform to the DatapointIterator interface

type DatapointGenerator

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

DatapointGenerator converts a map of data to a datapoint, making sure that the associated timestamp is correctly parsed and converted. It modifies the map during execution

func EmptyDatapointGenerator

func EmptyDatapointGenerator() *DatapointGenerator

EmptyDatapointGenerator returns datapoints without timestamps. For use on datasets which do not have timestamps defined

func NewDatapointGenerator

func NewDatapointGenerator(sampledata map[string]interface{}, keyhint string) (*DatapointGenerator, error)

NewDatapointGenerator creates a new generator

func (*DatapointGenerator) Generate

func (t *DatapointGenerator) Generate(data map[string]interface{}) (*pipescript.Datapoint, error)

Generate performs the generation of datapoint

type DatapointReader

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

DatapointReader

func NewDatapointReader

func NewDatapointReader(r io.Reader) (*DatapointReader, error)

func (*DatapointReader) Next

Next allows us to conform to the DatapointIterator interface

type JSONDatapointReader

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

JSONDatapointReader

func NewJSONDatapointReader

func NewJSONDatapointReader(r io.Reader, timestamphint string, disabletimestamp bool) (*JSONDatapointReader, error)

NewJSONDatapointReader creates a new readed for JSON files, using the optional timestamp key hint and optional disabling of timestamp

func (*JSONDatapointReader) Next

Next allows us to conform to the DatapointIterator interface

type JsonReader

type JsonReader struct {
	Separator []byte // The separator to use between datapoints
	Ender     []byte
	// contains filtered or unexported fields
}

JsonReader imitates an io.Reader interface

func NewJsonArrayReader

func NewJsonArrayReader(data pipescript.Iterator) (*JsonReader, error)

NewJsonArrayReader creates a new json array reader object. Allows using a RangeReader as an io.Reader type which outputs json. This reads the DataRange as a json array. (ie, [{},[],])

func NewJsonReader

func NewJsonReader(data pipescript.Iterator, starter, separator, footer, preindent, indent string) (*JsonReader, error)

NewJsonReader creates a JsonReader with the given separator

func (*JsonReader) Read

func (r *JsonReader) Read(p []byte) (n int, err error)

Read reads the given number of bytes from the DataRange, and p is the buffer to read into

Jump to

Keyboard shortcuts

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