parser

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MinParallelSize = 1 * 1024 * 1024

Variables

View Source
var (
	ErrBareQuote     = errors.New("bare quote in unquoted field")
	ErrUnclosedQuote = errors.New("unclosed quoted field")
	ErrFieldCount    = errors.New("row field count mismatch")
)

Functions

func ReadAll

func ReadAll(r io.Reader, d dialect.Dialect) ([][]string, error)

Types

type ParseError

type ParseError struct {
	Line   int
	Column int
	Offset int64
	Err    error
}

func ParseBytes added in v0.2.0

func ParseBytes(data []byte, d dialect.Dialect, unsafeStrings bool) ([][]string, []*ParseError, error)

func ParseBytesParallel added in v0.2.0

func ParseBytesParallel(data []byte, d dialect.Dialect, unsafeStrings bool, workers int) ([][]string, []*ParseError, error)

func (*ParseError) Error

func (e *ParseError) Error() string

func (*ParseError) Unwrap

func (e *ParseError) Unwrap() error

type Parser

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

func New

func New(r io.Reader, d dialect.Dialect) *Parser

func (*Parser) Done

func (p *Parser) Done() bool

func (*Parser) Err

func (p *Parser) Err() error

func (*Parser) Line

func (p *Parser) Line() int

func (*Parser) Next

func (p *Parser) Next() ([]string, error)

func (*Parser) Offset

func (p *Parser) Offset() int64

type Writer

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

func NewWriter

func NewWriter(w io.Writer, d dialect.Dialect) *Writer

func (*Writer) Error

func (w *Writer) Error() error

func (*Writer) Flush

func (w *Writer) Flush() error

func (*Writer) WriteAll

func (w *Writer) WriteAll(rows [][]string) error

func (*Writer) WriteRow

func (w *Writer) WriteRow(row []string) error

Jump to

Keyboard shortcuts

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