exchange

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTerminate = errors.New("reader is terminated")
	ErrEmpty     = errors.New("chan is empty")
	ErrShutdown  = errors.New("exchange is shutdowned")
)

Error Enumeration - An enumeration of possible errors

Functions

This section is empty.

Types

type RecordExchanger

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

RecordExchanger - A component responsible for exchanging records

func NewRecordExchanger

func NewRecordExchanger(ch *channel.Channel, tran transform.Transformer) *RecordExchanger

NewRecordExchanger - Creates a new instance of a RecordExchanger based on a channel (ch) and a transformer (tran)

func NewRecordExchangerWithoutTransformer

func NewRecordExchangerWithoutTransformer(ch *channel.Channel) *RecordExchanger

NewRecordExchangerWithoutTransformer - Creates a new instance of a RecordExchanger without a transformer

func (*RecordExchanger) CreateRecord

func (r *RecordExchanger) CreateRecord() (element.Record, error)

CreateRecord - Creates a new record

func (*RecordExchanger) Flush

func (r *RecordExchanger) Flush() error

Flush - Flushes any pending data, but is an empty method in this context

func (*RecordExchanger) GetFromReader

func (r *RecordExchanger) GetFromReader() (newRecord element.Record, err error)

GetFromReader - Retrieves records from the Reader An error will be reported if the exchanger is closed, the channel is empty, or a termination message is received

func (*RecordExchanger) SendWriter

func (r *RecordExchanger) SendWriter(record element.Record) (err error)

SendWriter - Writes a record (recode) to the writer, potentially transforming it through a transformer An error will be reported if the transformation fails or if the channel is closed

func (*RecordExchanger) Shutdown

func (r *RecordExchanger) Shutdown() error

Shutdown - Closes the exchanger

func (*RecordExchanger) Terminate

func (r *RecordExchanger) Terminate() error

Terminate - Terminates the record exchange process

Jump to

Keyboard shortcuts

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