Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSV ¶
CSV is real data parser for CSV file. It should implement parser.RawDataParser interface
func NewCsvReader ¶
NewCsvReader is func to create a CSV data parser
func (*CSV) CurrentLine ¶
CurrentLine is func to get current line(include the header line) Sample. Save This and got this line.
func (*CSV) CurrentLineNum ¶
CurrentLineNum is func to get current line number(include the header line) Sample. Save This and got this line.
func (*CSV) InitIndex ¶
func (c *CSV) InitIndex(Selectors []parser.DocumentQuery)
InitIndex func will set the Index of Column in Selector
func (*CSV) Select ¶
func (c *CSV) Select(s []parser.DocumentQuery) error
Select func will select the data from one line in file.
func (*CSV) SetDelimiter ¶
SetDelimiter is func to set CSV.Recorder.Comma
type JSON ¶
type JSON struct { Recorder *bufio.Scanner CurrLine string // contains filtered or unexported fields }
JSON is real data parser for JSON file. It should implement parser.RawDataParser interface
func NewJsonReader ¶
NewJsonReader is func to create a JSON data parser
func (*JSON) CurrentLine ¶
CurrentLine func will return the current decoding record.
func (*JSON) InitIndex ¶
func (j *JSON) InitIndex(selectors []parser.DocumentQuery)
InitIndex Set the selectors index. Useless for json there.
type Reader ¶
type Reader struct { // Comma is the field delimiter. // It is set to comma (',') by NewReader. // Comma must be a valid rune and must not be \r, \n, // or the Unicode replacement character (0xFFFD). Comma rune // Comment, if not 0, is the comment character. Lines beginning with the // Comment character without preceding whitespace are ignored. // With leading whitespace the Comment character becomes part of the // field, even if TrimLeadingSpace is true. // Comment must be a valid rune and must not be \r, \n, // or the Unicode replacement character (0xFFFD). // It must also not be equal to Comma. Comment rune // FieldsPerRecord is the number of expected fields per record. // If FieldsPerRecord is positive, Read requires each record to // have the given number of fields. If FieldsPerRecord is 0, Read sets it to // the number of fields in the first record, so that future records must // have the same field count. If FieldsPerRecord is negative, no check is // made and records may have a variable number of fields. FieldsPerRecord int // If LazyQuotes is true, a quote may appear in an unquoted field and a // non-doubled quote may appear in a quoted field. LazyQuotes bool // If TrimLeadingSpace is true, leading white space in a field is ignored. // This is done even if the field delimiter, Comma, is white space. TrimLeadingSpace bool // ReuseRecord controls whether calls to Read may return a slice sharing // the backing array of the previous call's returned slice for performance. // By default, each call to Read returns newly allocated memory owned by the caller. ReuseRecord bool TrailingComma bool // Deprecated: No longer used. // rawBuffer is a line buffer only used by the readLine method. RawBuffer []byte // contains filtered or unexported fields }
Hack for Got CSV File using reflect get Current Error Line Reader csv defined.