csv

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	HasHeader             bool // When true, treat the first record as a header
	RecordsProduceObjects bool // When false, produce an array for each record, else an object
	// contains filtered or unexported fields
}

A Decoder reads CSV input and streams it into a JSON stream.

func NewDecoder

func NewDecoder(in io.Reader) *Decoder

NewDecoder sets up a new Decoder instance to read from the given input.

func (*Decoder) Produce

func (d *Decoder) Produce(out chan<- token.Token) error

Produce reads a stream of CSV records, until it runs out of input or encounters invalid CSV, in which case it will return an error

func (*Decoder) SetFieldNames

func (d *Decoder) SetFieldNames(record []string)

SetFieldNames sets the field names for records. Should be called before Produce.

Jump to

Keyboard shortcuts

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