extension

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 11 Imported by: 10

Documentation

Overview

Package extension provides basic connector implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChanSink

type ChanSink struct {
	Out chan any
}

ChanSink represents an outbound connector that writes streaming data to a channel.

func NewChanSink

func NewChanSink(out chan any) *ChanSink

NewChanSink returns a new ChanSink connector.

func (*ChanSink) In

func (ch *ChanSink) In() chan<- any

In returns the input channel of the ChanSink connector.

type ChanSource

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

ChanSource represents an inbound connector that creates a stream of elements from a channel.

func NewChanSource

func NewChanSource(in chan any) *ChanSource

NewChanSource returns a new ChanSource connector.

func (*ChanSource) Out

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

Out returns the output channel of the ChanSource connector.

func (*ChanSource) Via

func (cs *ChanSource) Via(operator streams.Flow) streams.Flow

Via streams data to a specified operator and returns it.

type ConnType added in v0.3.0

type ConnType string

ConnType represents a connection type.

const (
	// TCP connection type
	TCP ConnType = "tcp"

	// UDP connection type
	UDP ConnType = "udp"
)

type FileSink

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

FileSink represents an outbound connector that writes streaming data to a file.

func NewFileSink

func NewFileSink(fileName string) *FileSink

NewFileSink returns a new FileSink connector.

func (*FileSink) In

func (fs *FileSink) In() chan<- any

In returns the input channel of the FileSink connector.

type FileSource

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

FileSource represents an inbound connector that creates a stream of elements from a file. The streaming element is a new line in the file.

func NewFileSource

func NewFileSource(fileName string) *FileSource

NewFileSource returns a new FileSource connector.

func (*FileSource) Out

func (fs *FileSource) Out() <-chan any

Out returns the output channel of the FileSource connector.

func (*FileSource) Via

func (fs *FileSource) Via(operator streams.Flow) streams.Flow

Via streams data to a specified operator and returns it.

type IgnoreSink

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

IgnoreSink represents a simple outbound connector that discards all elements of a stream.

func NewIgnoreSink

func NewIgnoreSink() *IgnoreSink

NewIgnoreSink returns a new IgnoreSink connector.

func (*IgnoreSink) In

func (ignore *IgnoreSink) In() chan<- any

In returns the input channel of the IgnoreSink connector.

type NetSink added in v0.3.0

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

NetSink represents an outbound network socket connector.

func NewNetSink added in v0.3.0

func NewNetSink(connType ConnType, address string) (*NetSink, error)

NewNetSink returns a new NetSink connector.

func (*NetSink) In added in v0.3.0

func (ns *NetSink) In() chan<- any

In returns the input channel of the NetSink connector.

type NetSource added in v0.3.0

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

NetSource represents an inbound network socket connector.

func NewNetSource added in v0.3.0

func NewNetSource(ctx context.Context, connType ConnType, address string) (*NetSource, error)

NewNetSource returns a new NetSource connector.

func (*NetSource) Out added in v0.3.0

func (ns *NetSource) Out() <-chan any

Out returns the output channel of the NetSource connector.

func (*NetSource) Via added in v0.3.0

func (ns *NetSource) Via(operator streams.Flow) streams.Flow

Via streams data to a specified operator and returns it.

type StdoutSink

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

StdoutSink represents a simple outbound connector that writes streaming data to standard output.

func NewStdoutSink

func NewStdoutSink() *StdoutSink

NewStdoutSink returns a new StdoutSink connector.

func (*StdoutSink) In

func (stdout *StdoutSink) In() chan<- any

In returns the input channel of the StdoutSink connector.

Jump to

Keyboard shortcuts

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