Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetProgress ¶
GetProgress is a callback function that periodically retrieves the current values for the following if not nil. This is used to send Progress messages back to client. BytesScanned => Number of bytes that have been processed before being uncompressed (if the file is compressed). BytesProcessed => Number of bytes that have been processed after being uncompressed (if the file is compressed).
type MessageHandler ¶
func NewMessageHandler ¶
func NewMessageHandler(ctx context.Context, w *bufio.Writer, getProgressFunc GetProgress) *MessageHandler
NewMessageHandler creates a new MessageHandler instance and starts the event streaming
func (*MessageHandler) Finish ¶
func (mh *MessageHandler) Finish(bytesScanned, bytesProcessed int64) error
Finish terminates message stream with Stats and End message generates stats and end message using function args based on: BytesScanned => Number of bytes that have been processed before being uncompressed (if the file is compressed). BytesProcessed => Number of bytes that have been processed after being uncompressed (if the file is compressed).
func (*MessageHandler) FinishWithError ¶
func (mh *MessageHandler) FinishWithError(errorCode, errorMessage string) error
FinishWithError terminates event stream with error
func (*MessageHandler) SendRecord ¶
func (mh *MessageHandler) SendRecord(payload []byte) error
SendRecord sends a single Records message