stream_ops

package
v0.98.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.0

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.0

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