csv

package
v0.0.0-...-4d00197 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: GPL-3.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 Reader

type Reader struct {
	//inner          *csv.Reader
	CaseSensHeader bool
	// contains filtered or unexported fields
}

Reader struct

func NewFileReader

func NewFileReader(fName string, separator string) (*Reader, error)

func NewReader

func NewReader(source []string, separator string) *Reader

func NewStringReader

func NewStringReader(source string, separator string) *Reader

func (*Reader) AcceptShortLines

func (r *Reader) AcceptShortLines()

if set, the parser will accept input lines with fewer columns than the header (is the last column is empty, some converters will skip it, hence this method could be useful)

func (*Reader) AllowMissingFields

func (r *Reader) AllowMissingFields()

AllowMissingFields allows missing fields in header

func (*Reader) AllowOrderMismatch

func (r *Reader) AllowOrderMismatch()

AllowOrderMismatch allows field order to mismatch between struct and header

func (*Reader) AllowUnknownFields

func (r *Reader) AllowUnknownFields()

AllowUnknownFields allows unknown fields in header

func (*Reader) NonStrict

func (r *Reader) NonStrict()

NonStrict allows unknown fields, missing fields, and field order mismatch

func (*Reader) ReadHeader

func (r *Reader) ReadHeader(v any) error

func (*Reader) ReadLine

func (r *Reader) ReadLine(v any) (bool, error)

ReadLine reads the next line from the input data Returns bool, error - bool is true if a line was read; false if we were at the end of the file

func (*Reader) RequiredFields

func (r *Reader) RequiredFields(fields ...string)

if set, the reader accepts headers missing any fields except for these

func (*Reader) Strict

func (r *Reader) Strict()

Strict disallows unknown fields, missing fields, and field order mismatch

func (*Reader) Unmarshal

func (r *Reader) Unmarshal(line []string, v any) error

Jump to

Keyboard shortcuts

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