api

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: 1 Imported by: 20

Documentation

Overview

API package with type definitions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchTrigger

type BatchTrigger interface {
	Done(ctx context.Context, item interface{}, index int64) bool
}

BatchTrigger interface provides logic to trigger when batch is done.

type BatchTriggerFunc

type BatchTriggerFunc func(context.Context, interface{}, int64) bool

BatchTriggerFunc a function type adapter that implements BatchTrigger

func (BatchTriggerFunc) Done

func (f BatchTriggerFunc) Done(ctx context.Context, item interface{}, index int64) bool

Done implements BatchOperation.Done

type BinFunc

type BinFunc func(context.Context, interface{}, interface{}) interface{}

BinFunc implements BinOperation as type func(context.Context, interface{}, interface{})

func (BinFunc) Apply

func (f BinFunc) Apply(ctx context.Context, op1, op2 interface{}) interface{}

Apply implements BinOpeartion.Apply

type BinOperation

type BinOperation interface {
	Apply(ctx context.Context, op1, op2 interface{}) interface{}
}

BinOperation interface represents binary opeartions (i.e. Reduce, etc)

type CancelStreamError

type CancelStreamError StreamError

CancelStreamError signals that all stream activities should stop and the streaming should gracefully end

func CancellationError

func CancellationError(msg string) CancelStreamError

CancellationError returns a CancelStreamError

func (CancelStreamError) Error

func (e CancelStreamError) Error() string

type Collector

type Collector interface {
	SetInput(<-chan interface{})
}

type Emitter

type Emitter interface {
	GetOutput() <-chan interface{}
}

type ErrorFunc

type ErrorFunc func(StreamError)

ErrorFunc this type is a user-provided function to handle errors

type LogFunc

type LogFunc func(interface{})

LogFunc represents a function to handle log events

type Operator

type Operator interface {
	Collector
	Emitter
	Exec(context.Context) error
}

Operator is an executor node that applies a function on items in the stream

type PanicStreamError

type PanicStreamError StreamError

PanicStreamError signals that the stream should panic immediately

func PanickingError

func PanickingError(msg string) PanicStreamError

PanickingError returns a PanicStreamError

func (PanicStreamError) Error

func (e PanicStreamError) Error() string

type Sink

type Sink interface {
	Collector
	Open(context.Context) <-chan error
}

type Source

type Source interface {
	Emitter
	Open(context.Context) error
}

type StreamError

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

StreamError is used to signal runtime stream error

func Error

func Error(msg string) StreamError

Error returns a StreamError

func ErrorWithItem

func ErrorWithItem(msg string, item *StreamItem) StreamError

ErrorWithItem returns a StreamError with provided StreamItem

func (StreamError) Error

func (e StreamError) Error() string

func (StreamError) Item

func (e StreamError) Item() *StreamItem

Item returns the StreamItem associated with the error

type StreamItem

type StreamItem struct {
	Index    int64             // index of the item in the stream
	Item     interface{}       // data item being stream
	MetaData map[string]string // user-provided stream metadat
	Context  context.Context   // stream context
}

StreamItem can be used to provide a rich repressentation of streaming data. Stream data can be wrapped in StreamItem carry additional information downstream including context, metadata, and error.

type UnFunc

type UnFunc func(context.Context, interface{}) interface{}

UnFunc implements UnOperation as type func (context.Context, interface{})

func (UnFunc) Apply

func (f UnFunc) Apply(ctx context.Context, data interface{}) interface{}

Apply implements UnOperation.Apply method

type UnOperation

type UnOperation interface {
	Apply(ctx context.Context, data interface{}) interface{}
}

UnOperation interface represents unary operations (i.e. Map, Filter, etc)

Directories

Path Synopsis
Package context wraps built-in type context.Context.
Package context wraps built-in type context.Context.

Jump to

Keyboard shortcuts

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