csv

package
v0.0.0-...-7bf970c Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package csv has the implementation of the file interface for csv files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSV

type CSV struct {
	//Filename is the name of the file
	Filename string
	//Name is the dataset name
	Name string
	//Resource holds the db instance of the underlying file
	Resource db.FileUpload
	//Table is the underlying octopus table node
	Table *interpreter.TableNode
}

CSV handles the fiels of csv type

func (CSV) ID

func (c CSV) ID() uint

ID returns the underlying file's id in db

func (*CSV) IdentifyColumns

func (c *CSV) IdentifyColumns(columns []interpreter.ColumnNode) ([]interpreter.ColumnNode, error)

IdentifyColumns will identify the columns in the file and store them in the database

func (*CSV) Store

func (c *CSV) Store(a *config.AppContext) (*brainModels.Dataset, error)

Store stores the csv info to database

func (*CSV) UpdateStatus

func (c *CSV) UpdateStatus(a *config.AppContext) error

UpdateStatus updates the status of the file upload in db

func (*CSV) Upload

func (c *CSV) Upload(a *config.AppContext, table interpreter.TableNode, appendData bool, createTable bool, dataStore services.Service) error

Upload will attempt to upload the file to the analytics engine and report any error occurred

func (*CSV) Validate

func (c *CSV) Validate() ([]error, error)

Validate will validate the csv file and returns the errors existing while parsing the csv file

Jump to

Keyboard shortcuts

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