stream_ops

package
v0.32.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package stream_ops exposes kernel stream operations to Flow DSL.

Typical use:

fs.walk -> stream.batch @{ size: 100 } -> process

Index

Constants

View Source
const ID = "stream_ops"

Variables

This section is empty.

Functions

func Bundle

func Bundle(_ map[string]string) compiler.Bundle

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 Library

func Library() action.Library

func Map added in v0.31.0

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

type FoldConfig struct {
	Initial    any    `json:"initial"`
	Expression string `json:"expression"`
}

FoldConfig configures stream.fold. Expression is evaluated once per input item with the current accumulator available as acc and the input as item.

Jump to

Keyboard shortcuts

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