csv

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: Apache-2.0 Imports: 14 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 {
	// contains filtered or unexported fields
}

Reader - CSV record reader for S3Select.

func NewReader

func NewReader(readCloser io.ReadCloser, args *ReaderArgs) (*Reader, error)

NewReader - creates new CSV reader using readCloser.

func (*Reader) Close

func (r *Reader) Close() error

Close - closes underlying reader.

func (*Reader) Read

func (r *Reader) Read(dst sql.Record) (sql.Record, error)

Read - reads single record. Once Read is called the previous record should no longer be referenced.

type ReaderArgs

type ReaderArgs struct {
	FileHeaderInfo             string `xml:"FileHeaderInfo"`
	RecordDelimiter            string `xml:"RecordDelimiter"`
	FieldDelimiter             string `xml:"FieldDelimiter"`
	QuoteCharacter             string `xml:"QuoteCharacter"`
	QuoteEscapeCharacter       string `xml:"QuoteEscapeCharacter"`
	CommentCharacter           string `xml:"Comments"`
	AllowQuotedRecordDelimiter bool   `xml:"AllowQuotedRecordDelimiter"`
	// contains filtered or unexported fields
}

ReaderArgs - represents elements inside <InputSerialization><CSV> in request XML.

func (*ReaderArgs) IsEmpty

func (args *ReaderArgs) IsEmpty() bool

IsEmpty - returns whether reader args is empty or not.

func (*ReaderArgs) UnmarshalXML

func (args *ReaderArgs) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

UnmarshalXML - decodes XML data.

type Record

type Record struct {
	// contains filtered or unexported fields
}

Record - is a CSV record.

func NewRecord

func NewRecord() *Record

NewRecord - creates new CSV record.

func (*Record) Clone

func (r *Record) Clone(dst sql.Record) sql.Record

Clone the record.

func (*Record) Get

func (r *Record) Get(name string) (*sql.Value, error)

Get - gets the value for a column name. CSV fields do not have any defined type (other than the default string). So this function always returns fields using sql.FromBytes so that the type specified/implied by the query can be used, or can be automatically converted based on the query.

func (*Record) Raw

func (r *Record) Raw() (sql.SelectObjectFormat, interface{})

Raw - returns the underlying data with format info.

func (*Record) Replace

func (r *Record) Replace(_ interface{}) error

Replace - is not supported for CSV

func (*Record) Reset

func (r *Record) Reset()

Reset data in record.

func (*Record) Set

func (r *Record) Set(name string, value *sql.Value) (sql.Record, error)

Set - sets the value for a column name.

func (*Record) WriteCSV

func (r *Record) WriteCSV(writer io.Writer, fieldDelimiter rune, quote rune, alwaysQuote bool) error

WriteCSV - encodes to CSV data.

func (*Record) WriteJSON

func (r *Record) WriteJSON(writer io.Writer) error

WriteJSON - encodes to JSON data.

type WriterArgs

type WriterArgs struct {
	QuoteFields          string `xml:"QuoteFields"`
	RecordDelimiter      string `xml:"RecordDelimiter"`
	FieldDelimiter       string `xml:"FieldDelimiter"`
	QuoteCharacter       string `xml:"QuoteCharacter"`
	QuoteEscapeCharacter string `xml:"QuoteEscapeCharacter"`
	// contains filtered or unexported fields
}

WriterArgs - represents elements inside <OutputSerialization><CSV/> in request XML.

func (*WriterArgs) IsEmpty

func (args *WriterArgs) IsEmpty() bool

IsEmpty - returns whether writer args is empty or not.

func (*WriterArgs) UnmarshalXML

func (args *WriterArgs) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

UnmarshalXML - decodes XML data.

Jump to

Keyboard shortcuts

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