tsv

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package tsv provides TSV import and export for the pulse I/O pipeline.

Package tsv provides TSV (tab-separated values) format adapters for the Pulse I/O pipeline.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader reads TSV data from a byte source.

func NewReader

func NewReader(fs afero.Fs, path string) *Reader

NewReader creates a TSV reader from a filesystem path.

func NewReaderFromBytes

func NewReaderFromBytes(data []byte) *Reader

NewReaderFromBytes creates a TSV reader from raw bytes.

func (*Reader) Close

func (r *Reader) Close() error

Close releases resources.

func (*Reader) ReadHeader

func (r *Reader) ReadHeader() ([]string, error)

ReadHeader returns column names from the first row.

func (*Reader) ReadRows

func (r *Reader) ReadRows(ctx context.Context, fn func(row []string) error) error

ReadRows streams rows to fn. ReadHeader must be called first.

func (*Reader) Reset

func (r *Reader) Reset() error

Reset rewinds the reader to the beginning.

type Writer

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

Writer writes TSV data.

func NewWriter

func NewWriter(fs afero.Fs, path string) *Writer

NewWriter creates a TSV writer targeting a filesystem path.

func NewWriterToBuffer

func NewWriterToBuffer() *Writer

NewWriterToBuffer creates a TSV writer that writes to an internal buffer.

func (*Writer) Bytes

func (w *Writer) Bytes() []byte

Bytes returns the buffered TSV output.

func (*Writer) Close

func (w *Writer) Close() error

Close flushes and writes to the target path if configured.

func (*Writer) WriteHeader

func (w *Writer) WriteHeader(columns []string) error

WriteHeader writes column names as the first TSV row.

func (*Writer) WriteRow

func (w *Writer) WriteRow(values []any) error

WriteRow writes a single data row.

Jump to

Keyboard shortcuts

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