zcsv

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidColumn = errors.New("no column with that name exists")
	ErrNoData        = errors.New("no data exists for that column")
)

Functions

func NewIterator added in v0.10.13

func NewIterator(reader *CsvReader) ziter.Iterator[Line]

Types

type CsvIterator added in v0.10.13

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

func (*CsvIterator) Err added in v0.12.0

func (c *CsvIterator) Err() error

func (*CsvIterator) Item added in v0.12.0

func (c *CsvIterator) Item() Line

func (*CsvIterator) Next added in v0.10.13

func (c *CsvIterator) Next() (hasMore bool)

type CsvReader

type CsvReader struct {
	*csv.Reader
	// contains filtered or unexported fields
}

func NewReader

func NewReader(source io.Reader, headers []string) (reader *CsvReader)

func (*CsvReader) Headers

func (r *CsvReader) Headers() (cols []string, err error)

func (*CsvReader) Read

func (r *CsvReader) Read() (line Line, err error)

func (*CsvReader) ReadAll

func (r *CsvReader) ReadAll() (lines []Line, err error)

func (*CsvReader) Scan added in v0.10.10

func (r *CsvReader) Scan(dest *any) (err error)

Scan a row into this destination

func (*CsvReader) ScanAll added in v0.10.10

func (r *CsvReader) ScanAll(dest any) (err error)

Scan all rows into a slice

type Line

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

func (Line) Data added in v0.9.19

func (l Line) Data() []string

func (Line) Get

func (l Line) Get(key string) (val string, err error)

func (Line) GetBool added in v0.10.10

func (l Line) GetBool(key string) (val bool, err error)

func (Line) GetFloat32 added in v0.10.10

func (l Line) GetFloat32(key string) (val float32, err error)

func (Line) GetFloat64 added in v0.10.10

func (l Line) GetFloat64(key string) (val float64, err error)

func (Line) GetInt added in v0.10.10

func (l Line) GetInt(key string) (val int, err error)

func (Line) GetInt32 added in v0.10.10

func (l Line) GetInt32(key string) (val int32, err error)

func (Line) GetInt64 added in v0.10.10

func (l Line) GetInt64(key string) (val int64, err error)

func (Line) GetTime added in v0.10.11

func (l Line) GetTime(key string, layouts ...string) (val time.Time, err error)

func (Line) GetUint added in v0.10.10

func (l Line) GetUint(key string) (val uint, err error)

func (Line) GetUint32 added in v0.10.10

func (l Line) GetUint32(key string) (val uint32, err error)

func (Line) GetUint64 added in v0.10.10

func (l Line) GetUint64(key string) (val uint64, err error)

func (Line) MustGet added in v0.9.19

func (l Line) MustGet(key string) string

Jump to

Keyboard shortcuts

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