Documentation ¶
Index ¶
- func NewState(ctx context.Context) *state
- type CursorNext
- type Filter
- type FilterPredicate
- type FlatMap
- type FlatMapFunction
- type FlowState
- type Inlet
- type Map
- type MapFunction
- type MemorySink
- type Optional
- type Outlet
- type Reduce
- type ReduceFunction
- type Sink
- type Source
- type Stater
- type StoreSink
- type Transfer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CursorNext ¶
type Filter ¶
Filter filters incoming elements using a filter predicate. If an element matches the predicate, the element is passed downstream. If not, the element is discarded.
in -- 1 -- 2 ---- 3 -- 4 ------ 5 --
[ -------- FilterPredicate -------- ]
out -- 1 -- 2 ------------------ 5 --
func NewFilter ¶
func NewFilter[T any](filterPredicate FilterPredicate[T], parallelism ...uint) *Filter[T]
NewFilter returns a new Filter instance.
filterPredicate is the boolean-valued filter function. parallelism is the flow parallelism factor. In case the events order matters, use parallelism = 1.
func (*Filter[T]) In ¶
func (f *Filter[T]) In() chan<- interface{}
In returns an input channel for receiving data
type FilterPredicate ¶
FilterPredicate represents a filter predicate (boolean-valued function).
type FlatMap ¶
FlatMap takes one element and produces zero, one, or more elements.
in -- 1 -- 2 ---- 3 -- 4 ------ 5 --
[ -------- FlatMapFunction -------- ]
out -- 1' - 2' -------- 4'- 4" - 5' -
func NewFlatMap ¶
func NewFlatMap[T, R any](flatMapFunction FlatMapFunction[T, R], parallelism ...uint) *FlatMap[T, R]
NewFlatMap returns a new FlatMap instance.
flatMapFunction is the FlatMap transformation function. parallelism is the flow parallelism factor. In case the events order matters, use parallelism = 1.
func (*FlatMap[T, R]) In ¶
func (fm *FlatMap[T, R]) In() chan<- interface{}
In returns an input channel for receiving data
type FlatMapFunction ¶
FlatMapFunction represents a FlatMap transformation function.
type FlowState ¶
type FlowState struct {
// contains filtered or unexported fields
}
func FlowStateWithContext ¶
func (*FlowState) HasStateErr ¶
func (*FlowState) SetStateErr ¶
type Inlet ¶
type Inlet interface { Stater In() chan<- interface{} }
Inlet represents a type that exposes one open input.
type Map ¶
Map takes one element and produces one element.
in -- 1 -- 2 ---- 3 -- 4 ------ 5 --
[ ---------- MapFunction ---------- ]
out -- 1' - 2' --- 3' - 4' ----- 5' -
func NewMap ¶
func NewMap[T, R any](mapFunction MapFunction[T, R], parallelism ...uint) *Map[T, R]
NewMap returns a new Map instance.
mapFunction is the Map transformation function. parallelism is the flow parallelism factor. In case the events order matters, use parallelism = 1.
func (*Map[T, R]) In ¶
func (m *Map[T, R]) In() chan<- interface{}
In returns an input channel for receiving data
type MapFunction ¶
MapFunction represents a Map transformation function.
type MemorySink ¶
func NewMemorySink ¶
func NewMemorySink[T any]() MemorySink[T]
type Optional ¶ added in v1.0.1
func NewEmptyOptional ¶ added in v1.0.1
func NewOptional ¶ added in v1.0.1
type Outlet ¶
type Outlet interface { Stater Out() <-chan interface{} }
Outlet represents a type that exposes one open output.
type Reduce ¶
Reduce represents a “rolling” reduce on a data stream. Combines the current element with the last reduced value and emits the new value.
in -- 1 -- 2 ---- 3 -- 4 ------ 5 --
[ --------- ReduceFunction --------- ]
out -- 1 -- 2' --- 3' - 4' ----- 5' -
func NewReduce ¶
func NewReduce[T any](reduceFunction ReduceFunction[T]) *Reduce[T]
NewReduce returns a new Reduce instance.
reduceFunction combines the current element with the last reduced value.
func (*Reduce[T]) In ¶
func (r *Reduce[T]) In() chan<- interface{}
In returns an input channel for receiving data
type ReduceFunction ¶
ReduceFunction combines the current element with the last reduced value.
type Sink ¶
type Sink interface { Inlet // contains filtered or unexported methods }
Sink represents a set of stream processing steps that has one open input.
type Source ¶
Source represents a set of stream processing steps that has one open output.
func NewDataStream ¶
func NewDataStreamOfCursor ¶
type Transfer ¶
Transfer represents a set of stream processing steps that has one open input and one open output.
func FanOut ¶
FanOut creates a number of identical flows from the single outlet. This can be useful when writing to multiple sinks is required.