json

package
v0.0.0-...-082243b Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PReader

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

PReader - JSON record reader for S3Select. Operates concurrently on line-delimited JSON.

func NewPReader

func NewPReader(readCloser io.ReadCloser, args *ReaderArgs) *PReader

NewPReader - creates new parallel JSON reader using readCloser. Should only be used for LINES types.

func (*PReader) Close

func (r *PReader) Close() error

Close - closes underlying reader.

func (*PReader) Read

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

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

type RawJSON

type RawJSON []byte

RawJSON is a byte-slice that contains valid JSON

func (RawJSON) MarshalJSON

func (b RawJSON) MarshalJSON() ([]byte, error)

MarshalJSON instance for []byte that assumes that byte-slice is already serialized JSON

type Reader

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

Reader - JSON record reader for S3Select.

func NewReader

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

NewReader - creates new JSON 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.

type ReaderArgs

type ReaderArgs struct {
	ContentType string `xml:"Type"`
	// contains filtered or unexported fields
}

ReaderArgs - represents elements inside <InputSerialization><JSON/> 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) error

UnmarshalXML - decodes XML data.

type Record

type Record struct {
	// Used in Set(), Marshal*()
	KVS jstream.KVS

	SelectFormat sql.SelectObjectFormat
}

Record - is JSON record.

func NewRecord

func NewRecord(f sql.SelectObjectFormat) *Record

NewRecord - creates new empty JSON record.

func (*Record) Clone

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

Clone the record and if possible use the destination provided.

func (*Record) Get

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

Get - gets the value for a column name.

func (*Record) Raw

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

Raw - returns the underlying representation.

func (*Record) Replace

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

Replace the underlying buffer of json data.

func (*Record) Reset

func (r *Record) Reset()

Reset the 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, opts sql.WriteCSVOpts) 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 {
	RecordDelimiter string `xml:"RecordDelimiter"`
	// contains filtered or unexported fields
}

WriterArgs - represents elements inside <OutputSerialization><JSON/> 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