extension

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 11 Imported by: 0

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 streams items to a channel.

func NewChanSink

func NewChanSink(out chan any) *ChanSink

NewChanSink returns a new ChanSink instance.

func (*ChanSink) In

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

In returns an input channel for receiving data.

type ChanSource

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

ChanSource represents an inbound connector that streams items from a channel.

func NewChanSource

func NewChanSource(in chan any) *ChanSource

NewChanSource returns a new ChanSource instance.

func (*ChanSource) Out

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

Out returns an output channel for sending data.

func (*ChanSource) Via

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

Via streams data through the given flow.

type ConnType

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 items to a file.

func NewFileSink

func NewFileSink(fileName string) *FileSink

NewFileSink returns a new FileSink instance.

func (*FileSink) In

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

In returns an input channel for receiving data.

type FileSource

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

FileSource represents an inbound connector that reads items from a file.

func NewFileSource

func NewFileSource(fileName string) *FileSource

NewFileSource returns a new FileSource instance.

func (*FileSource) Out

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

Out returns an output channel for sending data.

func (*FileSource) Via

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

Via streams data through the given flow.

type IgnoreSink

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

IgnoreSink represents a simple outbound connector that discards all of the incoming items.

func NewIgnoreSink

func NewIgnoreSink() *IgnoreSink

NewIgnoreSink returns a new IgnoreSink instance.

func (*IgnoreSink) In

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

In returns an input channel for receiving data.

type NetSink

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

NetSink represents an outbound network socket connector.

func NewNetSink

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

NewNetSink returns a new instance of NetSink.

func (*NetSink) In

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

In returns an input channel for receiving data.

type NetSource

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

NetSource represents an inbound network socket connector.

func NewNetSource

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

NewNetSource returns a new instance of NetSource.

func (*NetSource) Out

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

Out returns an output channel for sending data.

func (*NetSource) Via

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

Via streams data through the given flow.

type StdoutSink

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

StdoutSink represents a simple outbound connector that sends incoming items to standard output.

func NewStdoutSink

func NewStdoutSink() *StdoutSink

NewStdoutSink returns a new StdoutSink instance.

func (*StdoutSink) In

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

In returns an input channel for receiving data.

Jump to

Keyboard shortcuts

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