datadirectory

package module
v0.0.0-...-d8ddbe0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2016 License: BSD-2-Clause Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DataDirPath  string
	DataVersion  string
	Etl          string
	Model        string
	ModelVersion string
	Service      string
	Site         string
}

Config holds all potential configuration arguments for a DataDirectory object. Only the DataDirPath is required.

type DataDirectory

type DataDirectory struct {
	RecordMaps   []map[string]string
	Site         string
	Model        string
	ModelVersion string
	DataVersion  string
	Etl          string
	DirPath      string
	FilePath     string
	// contains filtered or unexported fields
}

DataDirectory represents a particular data directory and a set of metadata for it and the data files within it.

func New

func New(cfg *Config) (*DataDirectory, error)

New creates a new DataDirectory object from a Config object. Only the Config.DataDirPath attribute is required.

func (*DataDirectory) PopulateMetadataFromData

func (d *DataDirectory) PopulateMetadataFromData() error

PopulateMetadataFromData fills the DataDirectory with metadata from the data files. Also, any information missing from the DataDirectory object is collected through command line prompts.

func (*DataDirectory) ReadMetadata

func (d *DataDirectory) ReadMetadata(r io.Reader) error

ReadMetadata reads metadata.csv-style data from the passed reader into the appropriate attributes.

func (*DataDirectory) ReadMetadataFromFile

func (d *DataDirectory) ReadMetadataFromFile() error

ReadMetadataFromFile reads data from an existing metadata.csv file into the appropriate attributes.

func (*DataDirectory) Validate

func (d *DataDirectory) Validate() error

Validate checks the validity of the DataDirectory object. Specifically, the file metadata is checked against any existing information on the DataDirectory object and then against information from the data models service. If all of those checks pass, then each checksum is checked for accuracy.

func (*DataDirectory) WriteMetadata

func (d *DataDirectory) WriteMetadata(w io.Writer) error

WriteMetadata writes metadata.csv-style data from the DataDirectory object to the passed writer.

func (*DataDirectory) WriteMetadataToFile

func (d *DataDirectory) WriteMetadataToFile() error

WriteMetadataToFile writes data from the DataDirectory object to the metadata.csv file. An existing metadata.csv will be overwritten.

Jump to

Keyboard shortcuts

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