unary

package
v0.1.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterFunc

func FilterFunc(f interface{}) (api.UnFunc, error)

FilterFunc returns a unary function (api.UnFunc) which applies the user-defined filtering to apply predicates that filters out data items from being included in the downstream. The provided user-defined function must be of type:

func(T)bool - where T is the type of incoming data item, bool is the value of the predicate

When the user-defined function returns false, the current processed data item will not be placed in the downstream processing.

func FlatMapFunc

func FlatMapFunc(f interface{}) (api.UnFunc, error)

FlatMapFunc returns an unary function which applies a user-defined function which takes incoming comsite items and deconstruct them into individual items which can then be re-streamed. The type for the user-defined function is:

func (T) R - where R is the original item, R is a slice of decostructed items

The slice returned should be restreamed by placing each item onto the stream for downstream processing.

func MapFunc

func MapFunc(f interface{}) (api.UnFunc, error)

MapFunc returns an unary function which applies the user-defined function which maps, one-to-one, the incomfing value to a new value. The user-defined function must be of type:

func(T) R - where T is the incoming item, R is the type of the returned mapped item

func ProcessFunc

func ProcessFunc(f interface{}) (api.UnFunc, error)

ProcessFunc returns a unary function which applies the specified user-defined function that processes data items from upstream and returns a result value. The provided function must be of type:

func(T) R
where T is the type of incoming item
R the type of returned processed item

Types

type UnaryOperator

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

UnaryOp is an executor node that can execute a unary operation (i.e. transformation, etc)

func New

func New() *UnaryOperator

NewUnary creates *UnaryOperator value

func (*UnaryOperator) Exec

func (o *UnaryOperator) Exec(ctx context.Context) (err error)

Exec is the entry point for the executor

func (*UnaryOperator) GetOutput

func (o *UnaryOperator) GetOutput() <-chan interface{}

GetOutput returns the output channel for the executor node

func (*UnaryOperator) SetConcurrency

func (o *UnaryOperator) SetConcurrency(concurr int)

SetConcurrency sets the concurrency level for the operation

func (*UnaryOperator) SetInput

func (o *UnaryOperator) SetInput(in <-chan interface{})

SetInput sets the input channel for the executor node

func (*UnaryOperator) SetOperation

func (o *UnaryOperator) SetOperation(op api.UnOperation)

SetOperation sets the executor operation

Jump to

Keyboard shortcuts

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