Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Published = true Unpublished = false )
Boolean indicators for publish flag
var ErrNoDataReturned = errors.New("no data returned in this row")
ErrNoDataReturned is returned if a Neo4j row has no data.
var ErrNoInstanceFound = errors.New("no instance found in datastore")
ErrNoInstanceFound is returned if no instance exists in neo4j
var ErrNoResultsFound = errors.New("the filter options created no results")
ErrNoResultsFound is returned if the selected filter options produce no results
var ErrUnrecognisedType = errors.New("the value returned was not a string")
ErrUnrecognisedType is returned if a Neo4j row does not have the expected string value.
Functions ¶
This section is empty.
Types ¶
type BoltRowReader ¶
type BoltRowReader struct {
// contains filtered or unexported fields
}
BoltRowReader translates Neo4j rows to CSV rows.
func NewBoltRowReader ¶
func NewBoltRowReader(rows BoltRows, connection DBConnection) *BoltRowReader
NewBoltRowReader returns a new reader instace for the given bolt rows.
func (*BoltRowReader) Close ¶
func (reader *BoltRowReader) Close() error
Close the reader and the connection (For pooled connections this will release it back into the pool)
func (*BoltRowReader) Read ¶
func (reader *BoltRowReader) Read() (string, error)
Read the next row, or return io.EOF
type CSVRowReader ¶
CSVRowReader provides a reader of individual rows (lines) of a CSV file.
type DBConnection ¶
type DBConnection interface {
Close() error
}
DBConnection provides a method to close the connection once all the rows have been read
type DimensionFilter ¶
type DimensionFilter struct { Name string `json:"name,omitempty"` Options []string `json:"options,omitempty"` }
DimensionFilter represents an object containing a list of dimension values and the dimension name
type DownloadItem ¶
type DownloadItem struct { HRef string `json:"href,omitempty"` Private string `json:"private,omitempty"` Public string `json:"public,omitempty"` Size string `json:"size,omitempty"` }
DownloadItem represents an object containing download details
type Downloads ¶
type Downloads struct { CSV *DownloadItem `json:"csv,omitempty"` XLS *DownloadItem `json:"xls,omitempty"` }
Downloads represent a list of download types
type Filter ¶
type Filter struct { FilterID string `json:"filter_id,omitempty"` InstanceID string `json:"instance_id"` DimensionFilters []*DimensionFilter `json:"dimensions,omitempty"` Published *bool `json:"published,omitempty"` Downloads *Downloads `json:"downloads,omitempty"` }
Filter represents a structure for a filter job
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is an io.Reader implementation that wraps a csvRowReader
func NewReader ¶
func NewReader(csvRowReader CSVRowReader) *Reader
NewReader returns a new io.Reader for the given csvRowReader.
func (*Reader) ObservationsCount ¶
ObservationsCount returns the total number of bytes read by this reader.
func (*Reader) TotalBytesRead ¶
TotalBytesRead returns the total number of bytes read by this reader.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents storage for observation data.
func (*Store) GetCSVRows ¶
func (store *Store) GetCSVRows(ctx context.Context, filter *Filter, limit *int) (CSVRowReader, error)
GetCSVRows returns a reader allowing individual CSV rows to be read. Rows returned can be limited, to stop this pass in nil. If filter.DimensionFilters is nil, empty or contains only empty values then a CSVRowReader for the entire dataset will be returned.