Documentation
¶
Overview ¶
Package flowkit provides generic pipeline primitives for composing data processing workflows.
FlowKit supports producers, consumers, iterators, streams, and functional operators.
Index ¶
- func Chunk[T any](values []T, size int) [][]T
- func Collect[T any](iterator Iterator[T]) []T
- func Compose[T any](functions ...func(T) T) func(T) T
- func Filter[T any](values []T, predicate func(T) bool) []T
- func Fold[T any, R any](values []T, initial R, fn func(R, T) R) R
- func Map[T any, R any](values []T, fn func(T) R) []R
- func Pipe[T any](value T, functions ...func(T) T) T
- func Reduce[T any, R any](values []T, initial R, fn func(R, T) R) R
- func Tap[T any](value T, fn func(T)) T
- type Consumer
- type Iterator
- type Pipeline
- type Producer
- type Stream
- type Transformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compose ¶
func Compose[T any]( functions ...func(T) T, ) func(T) T
Compose creates a transformation chain.
Functions execute from left to right.
func Pipe ¶
func Pipe[T any]( value T, functions ...func(T) T, ) T
Pipe applies a value through multiple functions.
Types ¶
type Iterator ¶
type Iterator[T any] struct { // contains filtered or unexported fields }
Iterator represents a lazy data source.
func NewIterator ¶
NewIterator creates a new iterator.
type Pipeline ¶
Pipeline represents:
Producer -> Transformer -> Consumer
It reads values from a producer, transforms them, and sends them to a consumer.
type Stream ¶
type Stream[T any] struct { // contains filtered or unexported fields }
Stream provides chainable collection operations.
type Transformer ¶
Transformer converts one value type into another.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.