internal

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: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfig

func GetConfig[C any](ctx context.Context) C

func WithConfig

func WithConfig(ctx context.Context, cfg any) context.Context

Types

type Aggregation

type Aggregation = GAggregation[any, any]

Aggregation represents a generic interface for performing incremental aggregation over input elements. 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 = GAggregator[any, any]

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 interface {
	Map(Mapper, ...string) Chain
	Explode(Exploder, ...string) Chain
	ExplodeByFactory(ExploderFactory, ...string) Chain
	Filter(Filter, ...string) Chain
	Sort(CompareFunc, ...string) Chain
	Transform(Transformer, ...string) Chain
	Aggregate(Aggregator, ...string) Chain
	Sequential(untypedChain Chain, name ...string) Chain
	Parallel(untypedChain Chain, processing processing.Processing, name ...string) Chain
	Stable(untypedChain Chain, processing processing.Processing, name ...string) Chain
	Conditional(c Condition, untypedChain Chain, name ...string) Chain
	Add(n Chain, name ...string) Chain
	Step(s Step) Chain

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

func New

func New() Chain

type CompareFunc

type CompareFunc = func(a, b any) int

type Condition

type Condition func(context.Context) bool

type Exploder

type Exploder = GExploder[any, any]

type ExploderFactory

type ExploderFactory = GExploderFactory[any, any]

type Filter

type Filter = GFilter[any]

type GAggregation

type GAggregation[I, O any] interface {
	// Aggregate consumes one element and optionally provides a set of new
	// elements based on the previously consumed set of elements. If called
	// in a parallel chain, the implementation must potentially be synchronized.
	Aggregate(I) []O
	// Finish must finally provide new elements based on the actual internal
	// state. It is called, after the last element has been propagated.
	Finish() []O
}

type GAggregator

type GAggregator[I, O any] = func() GAggregation[I, O]

type GExploder

type GExploder[I, O any] func(I) []O

type GExploderFactory

type GExploderFactory[I, O any] func(context.Context) GExploder[I, O]

func GExploderFactoryFor

func GExploderFactoryFor[I, O any](e GExploder[I, O]) GExploderFactory[I, O]

type GFilter

type GFilter[I any] func(I) bool

type GMapper

type GMapper[I, O any] = func(I) O

type Mapper

type Mapper = GMapper[any, any]

type Step

type Step interface {
	String() string
	GetName() string
	Renamed(name string) Step
	// contains filtered or unexported methods
}

func AggregationStep

func AggregationStep(m Aggregator, name ...string) Step

func ConditionalStep

func ConditionalStep(m Condition, n Chain, name ...string) Step

func ExplodeStep

func ExplodeStep(m Exploder, name ...string) Step

func ExplodeStepByFactory

func ExplodeStepByFactory(m ExploderFactory, name ...string) Step

func FilterStep

func FilterStep(m Filter, name ...string) Step

func MappingStep

func MappingStep(m Mapper, name ...string) Step

func ParallelStep

func ParallelStep(n Chain, pool processing.Processing, name ...string) Step

func SequentialStep

func SequentialStep(n Chain, name ...string) Step

func SortStep

func SortStep(m CompareFunc, name ...string) Step

func StableStep

func StableStep(n Chain, pool processing.Processing, name ...string) Step

func TransformStep

func TransformStep(m Transformer, name ...string) Step

type Transformer

type Transformer = func(a []any) []any

Jump to

Keyboard shortcuts

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