Documentation ¶
Index ¶
- type Reader
- func (r *Reader) AcceptShortLines()
- func (r *Reader) AllowMissingFields()
- func (r *Reader) AllowOrderMismatch()
- func (r *Reader) AllowUnknownFields()
- func (r *Reader) NonStrict()
- func (r *Reader) ReadHeader(v any) error
- func (r *Reader) ReadLine(v any) (bool, error)
- func (r *Reader) RequiredFields(fields ...string)
- func (r *Reader) Strict()
- func (r *Reader) Unmarshal(line []string, v any) error
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 NewStringReader ¶
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 (*Reader) ReadLine ¶
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 ¶
if set, the reader accepts headers missing any fields except for these