Documentation
¶
Index ¶
- Variables
- func GetByteTableLoader(id table.ID, csvBytes []byte, conf *ReaderConfig) config.TableLoader
- func GetURLTableLoader(id table.ID, csvURL string, conf *ReaderConfig) config.TableLoader
- func Read(r io.Reader, conf *ReaderConfig) (t *table.Table, err error)
- func ReadURL(csvURL string, conf *ReaderConfig) (t *table.Table, err error)
- type ReaderConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = &ReaderConfig{
Comma: ',',
}
Functions ¶
func GetByteTableLoader ¶
func GetByteTableLoader(id table.ID, csvBytes []byte, conf *ReaderConfig) config.TableLoader
func GetURLTableLoader ¶
func GetURLTableLoader(id table.ID, csvURL string, conf *ReaderConfig) config.TableLoader
Types ¶
type ReaderConfig ¶
type ReaderConfig 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
}
ReaderConfig is essentially a copy of encoding/csv.Reader and is used to configure it
Click to show internal directories.
Click to hide internal directories.