Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedCSVWriter ¶
type BufferedCSVWriter struct {
// contains filtered or unexported fields
}
BufferedCSVWriter implements DataProcessor interface
func NewBufferedCSVWriter ¶
func NewBufferedCSVWriter(filename string, bufferSize int, flushInterval time.Duration) (*BufferedCSVWriter, error)
NewBufferedCSVWriter creates a new BufferedCSVWriter
func (*BufferedCSVWriter) Close ¶
func (w *BufferedCSVWriter) Close() error
Close flushes any remaining data and closes the CSV file
func (*BufferedCSVWriter) GetBufferSize ¶
func (w *BufferedCSVWriter) GetBufferSize() int
GetBufferSize returns the current size of the buffer
func (*BufferedCSVWriter) GetProcessedCount ¶
func (w *BufferedCSVWriter) GetProcessedCount() int
GetProcessedCount returns the number of processed messages
func (*BufferedCSVWriter) Process ¶
func (w *BufferedCSVWriter) Process(data models.FormattedData)
Process implements the DataProcessor interface
type DataProcessor ¶
type DataProcessor interface { Process(data models.FormattedData) GetProcessedCount() int GetBufferSize() int }
DataProcessor interface for the Observer pattern
type PGWriter ¶ added in v1.1.1
type PGWriter struct {
// contains filtered or unexported fields
}
PGWriter implements DataProcessor interface for PostgreSQL
func NewPGWriter ¶ added in v1.1.1
NewPGWriter creates a new PGWriter
func (*PGWriter) GetBufferSize ¶ added in v1.1.1
GetBufferSize returns the current size of the buffer (always 0 for immediate insert)
func (*PGWriter) GetProcessedCount ¶ added in v1.1.1
GetProcessedCount returns the number of processed messages
func (*PGWriter) Process ¶ added in v1.1.1
func (w *PGWriter) Process(data models.FormattedData)
Process implements the DataProcessor interface