chain

package
v0.0.0-...-a89a7b4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertAggregator

func ConvertAggregator[NI, NO, I, O any](in Aggregator[I, O]) internal.GAggregator[NI, NO]

func ConvertExploder

func ConvertExploder[NI, NO, I, O any](m Exploder[I, O]) internal.GExploder[NI, NO]

ConvertExploder converts an Exploder of type I to O into an Exploder of type NI to NO using type assertions and slice conversion.

func ConvertExploderFactory

func ConvertExploderFactory[NI, NO, I, O any](m ExploderFactory[I, O]) internal.GExploderFactory[NI, NO]

func ConvertFilter

func ConvertFilter[N, I any](m Filter[I]) internal.GFilter[N]

ConvertFilter adapts a Filter of type I to a Filter of type N using type assertions for compatibility in chains.

func ConvertMapper

func ConvertMapper[NI, NO, I, O any](m Mapper[I, O]) internal.GMapper[NI, NO]

ConvertMapper is a generic function that adapts a Mapper of one type pair to another using type conversions.

Types

type Aggregation

type Aggregation[I, O any] interface {
	internal.GAggregation[I, O]
}

Aggregation represents a generic interface for performing incremental aggregation over input elements. The input type is represented by I and the output type by O. The Aggregate method processes input elements and optionally finalizes aggregation for the current input batch. The Finish method finalizes and retrieves still pending aggregated results.

type Aggregator

type Aggregator[I, O any] = func() Aggregation[I, O]

Aggregator is a factory function creating an aggregation object. The generated object typically has its own local state to process the aggregation.

type Chain

type Chain[I, O any] interface {
	Execute(ctx context.Context, seq iter.Seq[I], name ...string) iter.Seq[O]
	ExecuteWithConfig(ctx context.Context, cfg any, seq iter.Seq[I], name ...string) iter.Seq[O]
	// contains filtered or unexported methods
}

func AddAggregation

func AddAggregation[N, I, O any](base Chain[I, O], m Aggregator[O, N], name ...string) Chain[I, N]

func AddChain

func AddChain[N, I, O any](base Chain[I, O], m Chain[O, N], name ...string) Chain[I, N]

func AddConditional

func AddConditional[I, O any](base Chain[I, O], m Condition, n Chain[O, O], name ...string) Chain[I, O]

func AddExplode

func AddExplode[N, I, O any](base Chain[I, O], m Exploder[O, N], name ...string) Chain[I, N]

func AddExplodeByFactory

func AddExplodeByFactory[N, I, O any](base Chain[I, O], m ExploderFactory[O, N], name ...string) Chain[I, N]

func AddFilter

func AddFilter[I, O any](base Chain[I, O], m Filter[O], name ...string) Chain[I, O]

func AddMap

func AddMap[N, I, O any](base Chain[I, O], m Mapper[O, N], name ...string) Chain[I, N]

func AddParallel

func AddParallel[N, I, O any](base Chain[I, O], p Chain[O, N], pool processing.Processing, name ...string) Chain[I, N]

func AddSequential

func AddSequential[I, O, N any](base Chain[I, O], p Chain[O, N]) Chain[I, N]

func AddSort

func AddSort[I, O any](base Chain[I, O], m CompareFunc[O], name ...string) Chain[I, O]

func AddStable

func AddStable[I, O, N any](base Chain[I, O], p Chain[O, N], pool processing.Processing, name ...string) Chain[I, N]

func AddStep

func AddStep[N, I, O any](base Chain[I, O], s Step[O, N]) Chain[I, N]

func AddTransform

func AddTransform[N, I, O any](base Chain[I, O], m Transformer[O, N], name ...string) Chain[I, N]

func Aggregated

func Aggregated[I, O any](m Aggregator[I, O], name ...string) Chain[I, O]

func ConditionalChain

func ConditionalChain[I any](m Condition, n Chain[I, I], name ...string) Chain[I, I]

func Exploded

func Exploded[I, O any](m Exploder[I, O], name ...string) Chain[I, O]

func ExplodedByFactory

func ExplodedByFactory[I, O any](m ExploderFactory[I, O], name ...string) Chain[I, O]

func Filtered

func Filtered[I any](m Filter[I], name ...string) Chain[I, I]

func ForStep

func ForStep[I, O any](s Step[I, O]) Chain[I, O]

func Mapped

func Mapped[I, O any](m Mapper[I, O], name ...string) Chain[I, O]

func New

func New[I any]() Chain[I, I]

func Parallel

func Parallel[I, O any](n Chain[I, O], pool processing.Processing, name ...string) Chain[I, O]

func Sequential

func Sequential[I, O any](p Chain[I, O]) Chain[I, O]

func Sorted

func Sorted[I any](m CompareFunc[I], name ...string) Chain[I, I]

func Stable

func Stable[I, O any](p Chain[I, O], pool processing.Processing, name ...string) Chain[I, O]

func Transformed

func Transformed[I, O any](m Transformer[I, O], name ...string) Chain[I, O]

type CompareFunc

type CompareFunc[I any] = func(a, b I) int

func ConvertCompareFunc

func ConvertCompareFunc[N, I any](f general.CompareFunc[I]) CompareFunc[N]

type Condition

type Condition = internal.Condition

type Exploder

type Exploder[I, O any] = internal.GExploder[I, O]

type ExploderFactory

type ExploderFactory[I, O any] = internal.GExploderFactory[I, O]

func ExploderFactoryFor

func ExploderFactoryFor[I, O any](e Exploder[I, O]) ExploderFactory[I, O]

type Filter

type Filter[I any] internal.GFilter[I]

type Mapper

type Mapper[I, O any] = internal.GMapper[I, O]

type Step

type Step[I, O any] interface {
	// contains filtered or unexported methods
}

func AggregationStep

func AggregationStep[I, O any](m Aggregator[I, O], name ...string) Step[I, O]

func ConditionalStep

func ConditionalStep[I any](m Condition, n Chain[I, I], name ...string) Step[I, I]

func ExplodeStep

func ExplodeStep[I, O any](m Exploder[I, O], name ...string) Step[I, O]

func ExplodeStepByFactory

func ExplodeStepByFactory[I, O any](m ExploderFactory[I, O], name ...string) Step[I, O]

func FilterStep

func FilterStep[I any](m Filter[I], name ...string) Step[I, I]

func MappingStep

func MappingStep[I, O any](m Mapper[I, O], name ...string) Step[I, O]

func ParallelStep

func ParallelStep[I any](p Chain[I, I], pool processing.Processing, name ...string) Step[I, I]

func SequentialStep

func SequentialStep[I, O any](p Chain[I, O], name ...string) Step[I, O]

func SortStep

func SortStep[I any](m CompareFunc[I], name ...string) Step[I, I]

func StableStep

func StableStep[I any](p Chain[I, I], pool processing.Processing, name ...string) Step[I, I]

func TransformStep

func TransformStep[I, O any](m Transformer[I, O], name ...string) Step[I, O]

type Transformer

type Transformer[I, O any] = func(in []I) []O

func ConvertTransformer

func ConvertTransformer[NI, NO, I, O any](f Transformer[I, O]) Transformer[NI, NO]

Jump to

Keyboard shortcuts

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