test_data

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArraysBulkAvroWriter added in v0.12.2

func ArraysBulkAvroWriter(writer io.Writer, writeTime time.Time, request <-chan *Arrays) <-chan error

ArraysBulkAvroWriter will begin a go routine writing an Avro Container File to the writer and add each item from the request channel. If an error is encountered it will be sent on the returned error channel. The given writeTime will be used for all data items written by this function. When the returned request channel is closed this function will finalize the Container File and exit. The returned error channel will be closed just before the go routine exits. Note: That though a nil item will be written as delete it will also be written without an ID or other identifying field and so this is of limited value. In general deletes should be done using WriteAvroDeletedCF.

func ComplexBulkAvroWriter added in v0.12.2

func ComplexBulkAvroWriter(writer io.Writer, writeTime time.Time, request <-chan *Complex) <-chan error

ComplexBulkAvroWriter will begin a go routine writing an Avro Container File to the writer and add each item from the request channel. If an error is encountered it will be sent on the returned error channel. The given writeTime will be used for all data items written by this function. When the returned request channel is closed this function will finalize the Container File and exit. The returned error channel will be closed just before the go routine exits. Note: That though a nil item will be written as delete it will also be written without an ID or other identifying field and so this is of limited value. In general deletes should be done using WriteAvroDeletedCF.

func RepeatsBulkAvroWriter added in v0.12.2

func RepeatsBulkAvroWriter(writer io.Writer, writeTime time.Time, request <-chan *Repeats) <-chan error

RepeatsBulkAvroWriter will begin a go routine writing an Avro Container File to the writer and add each item from the request channel. If an error is encountered it will be sent on the returned error channel. The given writeTime will be used for all data items written by this function. When the returned request channel is closed this function will finalize the Container File and exit. The returned error channel will be closed just before the go routine exits. Note: That though a nil item will be written as delete it will also be written without an ID or other identifying field and so this is of limited value. In general deletes should be done using WriteAvroDeletedCF.

func SimpleBulkAvroWriter added in v0.12.2

func SimpleBulkAvroWriter(writer io.Writer, writeTime time.Time, request <-chan *Simple) <-chan error

SimpleBulkAvroWriter will begin a go routine writing an Avro Container File to the writer and add each item from the request channel. If an error is encountered it will be sent on the returned error channel. The given writeTime will be used for all data items written by this function. When the returned request channel is closed this function will finalize the Container File and exit. The returned error channel will be closed just before the go routine exits. Note: That though a nil item will be written as delete it will also be written without an ID or other identifying field and so this is of limited value. In general deletes should be done using WriteAvroDeletedCF.

Types

type Arrays added in v0.12.2

type Arrays struct {
	Heights []int64 `json:"heights,omitempty"`
	Parents []struct {
		Count    int64    `json:"count"`
		Children []string `json:"children"`
	} `json:"parents"`
}

func (*Arrays) WriteAvroCF added in v0.12.2

func (z *Arrays) WriteAvroCF(writer io.Writer, writeTime time.Time) error

WriteAvroCF writes an Avro Containter File to the given io.Writer using snappy compression for the data. The time is used as the AvroWriteTime, if the time is the Zero value then the current time is used. NOTE: If the type has a field in an embedded struct with the same name as a field not in the embedded struct the value will be pulled from the field not in the embedded struct.

func (*Arrays) WriteAvroDeletedCF added in v0.12.3

func (z *Arrays) WriteAvroDeletedCF(writer io.Writer, writeTime time.Time) error

WriteAvroDeletedCF works nearly identically to WriteAvroCF but sets the AvroDeleted metadata field to true.

type Complex

type Complex struct {
	Simple

	Caption string `json:"caption"`
	Credit  string `json:"credit"`
	Crops   []struct {
		Height       float64 `json:"height"`
		Name         string  `json:"name"`
		Path         string  `json:"path" description:"full path to the cropped image file"`
		RelativePath string  `json:"relativePath" description:"a long"`
		Width        float64 `json:"width"`
	} `json:"crops"`
	Cutline        string    `json:"cutline,omitempty"`
	DatePhotoTaken time.Time `json:"datePhotoTaken"`
	Orientation    string    `json:"orientation"`
	OriginalSize   struct {
		Height float64 `json:"height"`
		Width  float64 `json:"width"`
	} `json:"originalSize"`
	Type string `json:"type" description:"a type"`
	URL  struct {
		Absolute string `json:"absolute"`
		Publish  string `json:"publish"`
	} `json:"URL"`
}

func (*Complex) WriteAvroCF

func (z *Complex) WriteAvroCF(writer io.Writer, writeTime time.Time) error

WriteAvroCF writes an Avro Containter File to the given io.Writer using snappy compression for the data. The time is used as the AvroWriteTime, if the time is the Zero value then the current time is used. NOTE: If the type has a field in an embedded struct with the same name as a field not in the embedded struct the value will be pulled from the field not in the embedded struct.

func (*Complex) WriteAvroDeletedCF added in v0.12.3

func (z *Complex) WriteAvroDeletedCF(writer io.Writer, writeTime time.Time) error

WriteAvroDeletedCF works nearly identically to WriteAvroCF but sets the AvroDeleted metadata field to true.

type Repeats

type Repeats struct {
	Height      int64 `json:"height,omitempty"`
	SomeDateObj struct {
		Type    string `json:"type"`
		Visible bool   `json:"visible,omitempty"`
	} `json:"someDateObj,omitempty"`
	Type    string  `json:"type"`
	Visible bool    `json:"visible,omitempty"`
	Width   float64 `json:"width,omitempty"`
}

func (*Repeats) WriteAvroCF

func (z *Repeats) WriteAvroCF(writer io.Writer, writeTime time.Time) error

WriteAvroCF writes an Avro Containter File to the given io.Writer using snappy compression for the data. The time is used as the AvroWriteTime, if the time is the Zero value then the current time is used. NOTE: If the type has a field in an embedded struct with the same name as a field not in the embedded struct the value will be pulled from the field not in the embedded struct.

func (*Repeats) WriteAvroDeletedCF added in v0.12.3

func (z *Repeats) WriteAvroDeletedCF(writer io.Writer, writeTime time.Time) error

WriteAvroDeletedCF works nearly identically to WriteAvroCF but sets the AvroDeleted metadata field to true.

type Simple

type Simple struct {
	Height      int64 `json:"height,omitempty"`
	SomeDateObj struct {
		Dates []time.Time `json:"dates,omitempty"`
	} `json:"someDateObj,omitempty"`
	Type    string  `json:"type"`
	Visible bool    `json:"visible,omitempty"`
	Width   float64 `json:"width,omitempty"`
}

func (*Simple) WriteAvroCF

func (z *Simple) WriteAvroCF(writer io.Writer, writeTime time.Time) error

WriteAvroCF writes an Avro Containter File to the given io.Writer using snappy compression for the data. The time is used as the AvroWriteTime, if the time is the Zero value then the current time is used. NOTE: If the type has a field in an embedded struct with the same name as a field not in the embedded struct the value will be pulled from the field not in the embedded struct.

func (*Simple) WriteAvroDeletedCF added in v0.12.3

func (z *Simple) WriteAvroDeletedCF(writer io.Writer, writeTime time.Time) error

WriteAvroDeletedCF works nearly identically to WriteAvroCF but sets the AvroDeleted metadata field to true.

Directories

Path Synopsis
avro

Jump to

Keyboard shortcuts

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