pipeline

package module
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate added in v0.0.2

func Aggregate[K comparable, I1, I2, A any](ctx context.Context, in1 Aggregator[I1, K], in2 Aggregator[I2, K], aggFn func(K, I1, I2) (A, error)) (chan A, chan error)

func Aggregate3 added in v0.0.2

func Aggregate3[K comparable, I1, I2, I3, A any](ctx context.Context, in1 Aggregator[I1, K], in2 Aggregator[I2, K], in3 Aggregator[I3, K], aggFn func(K, I1, I2, I3) (A, error)) (chan A, chan error)

func Chan added in v0.0.5

func Chan[I any](f func() (I, error)) (chan I, chan error)

func Merge

func Merge[T any](ctx context.Context, chs ...chan T) <-chan T

Merge collects data from all input channels and send it to output channel.

All input and output channels have same type.

func PassingFn added in v0.0.4

func PassingFn[In any](in In) (In, error)

func Source

func Source[In any](ctx context.Context, in ...In) chan In

func Split added in v0.0.3

func Split[In, O1, O2 any](
	ctx context.Context,
	chIn <-chan In,
	sa1 *stepaction.StepAction[In, O1],
	sa2 *stepaction.StepAction[In, O2],
	opts ...StepOption,
) (chan O1, chan O2, chan error)

func StaticKeyFn added in v0.0.7

func StaticKeyFn[T any](i T) int

func Step

func Step[In, Out any](
	ctx context.Context,
	chIn <-chan In,
	stepAction *stepaction.StepAction[In, Out],
	opts ...StepOption,
) (chan Out, chan error)

func TestAggregate3 added in v0.0.2

func TestAggregate3(t *testing.T)

func TestAggregate3Error added in v0.0.6

func TestAggregate3Error(t *testing.T)

Types

type Aggregator added in v0.0.2

type Aggregator[I, K any] struct {
	Ch    chan I
	KeyFn func(I) K
}

type StepOption

type StepOption func(*stepConfig)

func WithLimit

func WithLimit(l int64) StepOption

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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