source

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package source contains several implementations of the batch.Source interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Input <-chan interface{}
}

Channel is a Source that reads from input until it is closed. The input channel can be buffered or unbuffered.

func (*Channel) Read

func (s *Channel) Read(ctx context.Context, ps *batch.PipelineStage)

Read reads from items until the input channel is closed.

type Error

type Error struct {
	Err error
}

Error is a Source that returns an error and then closes immediately. It can be used as a mock Source.

func (*Error) Read

func (s *Error) Read(ctx context.Context, ps *batch.PipelineStage)

Read returns an error and then closes.

type Nil

type Nil struct {
	Duration time.Duration
}

Nil is a Source that doesn't read any data. Instead it closes the pipeline stage after specified duration. It can be used as a mock Source.

func (*Nil) Read

func (s *Nil) Read(ctx context.Context, ps *batch.PipelineStage)

Read doesn't read anything.

Jump to

Keyboard shortcuts

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