csv

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package csv implements a Writer that writes transactions to a CSV file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// FilePath is the path to the CSV output file.
	FilePath string
	// BatchSize is the number of transactions to buffer before writing.
	BatchSize int
	// FlushInterval is the interval between automatic flushes.
	FlushInterval int // seconds
}

Config holds configuration for the CSV writer.

type Writer

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

Writer writes transactions to a CSV file with buffered batching.

func New

func New(cfg Config, logger *slog.Logger) (*Writer, error)

New creates a new CSV writer.

func (*Writer) Close

func (w *Writer) Close() error

Close closes the CSV file.

func (*Writer) Write

func (w *Writer) Write(ctx context.Context, in <-chan *api.TransactionDetails, ackChan chan<- string) error

Write consumes transactions from the input channel and writes them to CSV.

Jump to

Keyboard shortcuts

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