Documentation
¶
Overview ¶
Package csvio owns streamio's CSV and TSV support: one package for both, since they differ only in field delimiter.
A CSV field has no type of its own, so every decoded field is record.KindBytes rather than sniffed as a number or bool.
Index ¶
- func NewDecoder(cfg options.Config, src options.Source) (formatio.RecordDecoder, error)
- func NewEncoder(cfg options.Config) (formatio.RecordEncoder, error)
- func NewRawSource(cfg options.Config, src options.Source) (formatio.RawSource, error)
- func NewStreamingEncoder(cfg options.Config) (formatio.RecordEncoder, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDecoder ¶
NewDecoder opens src as a stream of canonical records. NewDecoder does not take ownership of src.Reader; the caller closes it, if it needs closing, once done with every decoder Split hands out.
func NewEncoder ¶
func NewEncoder(cfg options.Config) (formatio.RecordEncoder, error)
NewEncoder returns an encoder rendering a batch of canonical records as one CSV/TSV document. SingleFileOutput selects the streaming encoder below instead: see NewStreamingEncoder.
func NewRawSource ¶
NewRawSource opens src for raw passthrough: each dispatched document is one row's raw bytes. NewRawSource does not take ownership of src.Reader; the caller closes it, if it needs closing, once done with the returned source.
func NewStreamingEncoder ¶
func NewStreamingEncoder(cfg options.Config) (formatio.RecordEncoder, error)
NewStreamingEncoder returns a formatio.FinalizableRecordEncoder producing one continuous CSV/TSV document across every batch in the run.
Types ¶
This section is empty.