pipe

package
v0.0.0-...-0e50cf9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

pipe package is responsible for holding all the logic of pipes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipe

type Pipe struct {
	Description string // a Description/name of the pipeline, used for monitoring
	// contains filtered or unexported fields
}

Pipe struct represents a pipeline through which data flows

func NewAggregateOpPipe

func NewAggregateOpPipe(ds string, ao func([]float64) (float64, error)) *Pipe

NewAggregateOpPipe returns a new instance of Pipe with an aggregate function

func NewSingleOpsPipe

func NewSingleOpsPipe(ds string, so []func(float64) (float64, error)) *Pipe

NewSingleOpsPipe returns a new instance of Pipe that uses single ops to modify values that flow through

func (*Pipe) Flow

func (p *Pipe) Flow() error

Flow flows the specified input through the specified pipe singleOp and stores the output

func (*Pipe) GetFlowDuration

func (p *Pipe) GetFlowDuration() time.Duration

GetFlowDuration tells how long the Flow operation needed to process the pipeline input

func (*Pipe) GetInput

func (p *Pipe) GetInput() map[string][]float64

GetInput returns the input that was specified to the pipe

func (*Pipe) GetOutput

func (p *Pipe) GetOutput() map[string][]float64

GetOutput allows a consumer to get the output of this pipe

func (*Pipe) SetInput

func (p *Pipe) SetInput(in map[string][]float64)

SetInput sets the inputs to the pipe, should only be accessed by a source

func (*Pipe) SetOutput

func (p *Pipe) SetOutput(ot map[string][]float64)

SetOutput sets the output of the pipe to a custom one that is not computed by Flow this is mostly implemented for testing purposes as we would otherwise have to set up CSV files for testing the Sink package

Jump to

Keyboard shortcuts

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