line

package
v0.147.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResultDecoder

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

ResultDecoder decodes raw input strings from a reader into a flux.Result. It uses a separator to split the input into tokens and generate table rows. Tokens are kept as they are and put into a table with schema `_time`, `_value`. The `_value` column contains tokens. The `_time` column contains the timestamps for when each `_value` has been read. Strings in `_value` are obtained from the io.Reader passed to the Decode function. ResultDecoder outputs one table once the reader reaches EOF.

func NewResultDecoder

func NewResultDecoder(config *ResultDecoderConfig) *ResultDecoder

NewResultDecoder creates a new result decoder from config.

func (*ResultDecoder) Decode

func (rd *ResultDecoder) Decode(r io.Reader) (flux.Result, error)

func (*ResultDecoder) Do

func (rd *ResultDecoder) Do(f func(flux.Table) error) error

func (*ResultDecoder) Name

func (*ResultDecoder) Name() string

func (*ResultDecoder) Tables

func (rd *ResultDecoder) Tables() flux.TableIterator

type ResultDecoderConfig

type ResultDecoderConfig struct {
	Separator    byte
	TimeProvider TimeProvider
}

ResultDecoderConfig is the configuration for a result decoder.

type TimeProvider

type TimeProvider interface {
	CurrentTime() values.Time
}

TimeProvider gives the current time.

Jump to

Keyboard shortcuts

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