csvp

package
v0.0.0-...-196ac19 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 5 Imported by: 1

README

csvp

-- import "github.com/cmcoffee/snugforge/csvp"

Usage

func IsReadError
func IsReadError(err error) bool

Returns true if error is generatored from reading the CSV.

func IsRowError
func IsRowError(err error) bool

Returns true if error is generated from processing the row of the CSV.

type CSVReader
type CSVReader struct {
	Processor    func(row []string) (err error)                     // Callback funcction for each row read.
	ErrorHandler func(line int, row string, err error) (abort bool) // ErrorHandler when problem reading CSV or processing CSV.
}
func NewReader
func NewReader() *CSVReader

Allocates a New CSVReader.

func (*CSVReader) Read
func (T *CSVReader) Read(reader io.Reader)

Reads incoming CSV data.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsReadError

func IsReadError(err error) bool

Returns true if error is generatored from reading the CSV.

func IsRowError

func IsRowError(err error) bool

Returns true if error is generated from processing the row of the CSV.

Types

type CSVReader

type CSVReader struct {
	Processor    func(row []string) (err error)                     // Callback funcction for each row read.
	ErrorHandler func(line int, row string, err error) (abort bool) // ErrorHandler when problem reading CSV or processing CSV.
}

func NewReader

func NewReader() *CSVReader

Allocates a New CSVReader.

func (*CSVReader) Read

func (T *CSVReader) Read(reader io.Reader)

Reads incoming CSV data.

Jump to

Keyboard shortcuts

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