Documentation ¶
Index ¶
- Variables
- type RecordExchanger
- func (r *RecordExchanger) CreateRecord() (element.Record, error)
- func (r *RecordExchanger) Flush() error
- func (r *RecordExchanger) GetFromReader() (newRecord element.Record, err error)
- func (r *RecordExchanger) SendWriter(record element.Record) (err error)
- func (r *RecordExchanger) Shutdown() error
- func (r *RecordExchanger) Terminate() error
Constants ¶
This section is empty.
Variables ¶
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