Documentation ¶
Overview ¶
Copyright 2022 Molecula Corp. (DBA FeatureBase). SPDX-License-Identifier: Apache-2.0
Index ¶
- type Format
- type Iterator
- func NewColumnIterator(format Format, reader io.Reader) *Iterator
- func NewColumnIteratorWithTimestampFormat(format Format, reader io.Reader, timestampFormat string) *Iterator
- func NewIterator(reader io.Reader, unmarshaller RecordUnmarshaller) *Iterator
- func NewValueIterator(format Format, reader io.Reader) *Iterator
- type RecordUnmarshaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Format ¶
type Format uint
Format is the format of the data in the CSV file.
const ( // RowIDColumnID formatted data is ROW_ID,COLUMN_ID. RowIDColumnID Format = iota // RowIDColumnKey formatted data is ROW_ID,COLUMN_KEY. RowIDColumnKey // RowKeyColumnID formatted data is ROW_KEY,COLUMN_ID. RowKeyColumnID // RowKeyColumnKey formatted data is ROW_KEY,COLUMN_ID. RowKeyColumnKey // ColumnID formatted data is COLUMN_ID. Valid only for value import. ColumnID // ColumnKey formatted data is COLUMN_KEY. Valud only for value import. ColumnKey )
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator reads records from a Reader. Each line should contain a single record in the following form: field1,field2,...
func NewColumnIterator ¶
NewColumnIterator creates a new iterator for column data.
func NewColumnIteratorWithTimestampFormat ¶
func NewColumnIteratorWithTimestampFormat(format Format, reader io.Reader, timestampFormat string) *Iterator
NewColumnIteratorWithTimestampFormat creates a new iterator for column data with timestamp.
func NewIterator ¶
func NewIterator(reader io.Reader, unmarshaller RecordUnmarshaller) *Iterator
NewIterator creates a CSVIterator from a Reader.
func NewValueIterator ¶
NewValueIterator creates a new iterator for value data.
type RecordUnmarshaller ¶
RecordUnmarshaller is a function which creates a Record from a CSV file line with column data.
func ColumnUnmarshaller ¶
func ColumnUnmarshaller(format Format) RecordUnmarshaller
ColumnUnmarshaller creates a RecordUnmarshaller for importing columns with the given format.
func ColumnUnmarshallerWithTimestamp ¶
func ColumnUnmarshallerWithTimestamp(format Format, timestampFormat string) RecordUnmarshaller
ColumnUnmarshallerWithTimestamp creates a RecordUnmarshaller for importing columns with the given format and timestamp format.
func FieldValueUnmarshaller ¶
func FieldValueUnmarshaller(format Format) RecordUnmarshaller
FieldValueUnmarshaller is a function which creates a Record from a CSV file line with value data.