sources

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanSource

type ChanSource struct {
	// contains filtered or unexported fields
}

ChanSource is a source that returns a channel of data.

func NewChanSource

func NewChanSource(out chan any) *ChanSource

NewChanSource returns a new ChanSource.

func (*ChanSource) Error

func (s *ChanSource) Error() error

Error returns the error.

func (*ChanSource) Out

func (s *ChanSource) Out() <-chan any

Out returns the channel of data.

func (*ChanSource) Pipe

Pipe pipes the output channel to the input channel.

type ElementReader

type ElementReader func(io.Reader) ([]byte, error)

ElementReader is a function that reads an element from an io.Reader.

type ReaderSource

type ReaderSource struct {
	// contains filtered or unexported fields
}

ReaderSource is a source connector that reads elements from an io.Reader.

func NewReaderSource

func NewReaderSource(reader io.ReadCloser, elementReader ElementReader) (*ReaderSource, error)

NewReaderSource returns a new ReaderSource connector that reads elements from.

func (*ReaderSource) Error

func (s *ReaderSource) Error() error

Error returns the error.

func (*ReaderSource) Out

func (s *ReaderSource) Out() <-chan any

Out returns the output channel of the ReaderSource connector.

func (*ReaderSource) Pipe

func (s *ReaderSource) Pipe(operator streams.Operatable) streams.Operatable

Pipe pipes the output channel of the ReaderSource connector to the input channel.

type SeqSource added in v0.4.1

type SeqSource[I any] struct {
	// contains filtered or unexported fields
}

SeqSource is a source that iterates over an iterable.

func NewSeqSource added in v0.4.1

func NewSeqSource[I any](seq iter.Seq[I]) (*SeqSource[I], error)

NewSeqSource returns a new SeqSource.

func (*SeqSource[I]) Error added in v0.4.1

func (s *SeqSource[I]) Error() error

Error returns the error.

func (*SeqSource[I]) Out added in v0.4.1

func (s *SeqSource[I]) Out() <-chan any

Out returns the output channel of the ReaderSource connector.

func (*SeqSource[I]) Pipe added in v0.4.1

func (s *SeqSource[I]) Pipe(operator streams.Operatable) streams.Operatable

Pipe pipes the output channel of the ReaderSource connector to the input channel.

Jump to

Keyboard shortcuts

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