Documentation
¶
Overview ¶
Package stream_ops exposes kernel stream operations to Flow DSL.
Typical use:
fs.walk -> stream.batch @{ size: 100 } -> process
Index ¶
- Constants
- func Bundle(_ map[string]string) compiler.Bundle
- func Filter(cfg ExpressionConfig) action.StreamOp[any, any]
- func FlatMap(cfg ExpressionConfig) action.StreamOp[any, any]
- func Fold(cfg FoldConfig) action.StreamOp[any, any]
- func Library() action.Library
- func Map(cfg ExpressionConfig) action.StreamOp[any, any]
- func Operators() []action.NamedOperator
- type ExpressionConfig
- type FoldConfig
Constants ¶
const ID = "stream_ops"
Variables ¶
This section is empty.
Functions ¶
func Filter ¶ added in v0.31.0
func Filter(cfg ExpressionConfig) action.StreamOp[any, any]
Filter evaluates Expression as a boolean predicate. Kernel's MapE preserves evaluation errors, Filter selects accepted items, and Map restores each item.
func FlatMap ¶ added in v0.31.0
func FlatMap(cfg ExpressionConfig) action.StreamOp[any, any]
FlatMap evaluates Expression to a []any for each item and expands it through Kernel's FlatMap and StreamFromSlice, preserving order and downstream stops.
func Fold ¶ added in v0.30.2
func Fold(cfg FoldConfig) action.StreamOp[any, any]
Fold consumes the complete stream and emits one accumulated value. Its expression is compiled once when the operator is built; evaluation remains streaming and retains only the accumulator.
func Map ¶ added in v0.31.0
func Map(cfg ExpressionConfig) action.StreamOp[any, any]
Map transforms each item by evaluating Expression and delegates iteration, upstream-error propagation, and downstream stopping to Kernel's MapE.
func Operators ¶
func Operators() []action.NamedOperator
Operators exposes the stateless stream manipulators into the DSL.
Types ¶
type ExpressionConfig ¶ added in v0.31.0
type ExpressionConfig struct {
Expression string `json:"expression" validate:"required"`
}
ExpressionConfig configures a stream transform using an expression over item.
type FoldConfig ¶ added in v0.30.2
FoldConfig configures stream.fold. Expression is evaluated once per input item with the current accumulator available as acc and the input as item.