Documentation ¶
Overview ¶
Package decoding handles decoding of CSV, TSV, JSON, and fixed length text.
Package decoding handles decoding of CSV, TSV, JSON, and fixed length text.
Package decoding handles decoding of CSV, TSV, JSON, and fixed length text.
Package decoding handles decoding of CSV, TSV, JSON, and fixed length text.
Package decoding handles decoding of CSV, TSV, JSON, and fixed length text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CsvDecoderOptions ¶
type CsvDecoderOptions struct { // Charset is an input character encoding (default: charset.UTF8) Charset charset.Charset // Charset default: ',' Separator rune // Header // If none specified: 1st line is header, 2nd and later lines are data // If one or more are specified: everything after the first line is data Header []string // HeaderAliases // Convert values obtained as headers (either explicitly in Header or from the first line of io.Reader) before they are actually processed by csvutil's CSV decoder. HeaderAliases map[string]string }
CsvDecoderOptions is an optional argument to NewCsvDecoder.
type Decoder ¶
Decoder handles decoding of CSV, TSV, JSON, and fixed length text.
func NewCsvDecoder ¶
func NewCsvDecoder[TRow any](src io.Reader, opts CsvDecoderOptions) Decoder[TRow]
NewCsvDecoder creates a Decoder that processes CSV/TSV. See csvutil documentation for structure tags: https://github.com/jszwec/csvutil
func NewFixedWidthDecoder ¶
func NewFixedWidthDecoder[TRow any](src io.Reader, opts FixedWidthDecoderOptions) Decoder[TRow]
NewFixedWidthDecoder creates a Decoder that processes fixed length fields. See the fixedwidth documentation for the structure tags: https://github.com/ianlopshire/go-fixedwidth
func NewJSONDecoder ¶
NewJSONDecoder creates a decoder that processes JSON. Note: This is not row-oriented JSONL, but JSON with an array directly under the root.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package adjuster provides a mechanism to relax the requirement for the number of CSV fields.
|
Package adjuster provides a mechanism to relax the requirement for the number of CSV fields. |
Package buffering provides a mechanism for peeking at CSV header lines.
|
Package buffering provides a mechanism for peeking at CSV header lines. |