detect

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: MIT Imports: 16 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CBORSchema

func CBORSchema(resource *dataset.Structure, data io.Reader) (schema map[string]interface{}, n int, err error)

CBORSchema determines the field names and types of an io.Reader of CBOR-formatted data, returning a json schema

func CSVSchema

func CSVSchema(resource *dataset.Structure, data io.Reader) (schema map[string]interface{}, n int, err error)

CSVSchema determines the field names and types of an io.Reader of CSV-formatted data, returning a json schema

func ExtensionDataFormat

func ExtensionDataFormat(path string) (format dataset.DataFormat, err error)

ExtensionDataFormat returns the corresponding DataFormat for a given file extension if one exists TODO - this should probably come from the dataset package

func FromFile

func FromFile(path string) (st *dataset.Structure, err error)

FromFile takes a filepath & tries to work out the corresponding dataset for the sake of speed, it only works with files that have a recognized extension

func FromReader

func FromReader(format dataset.DataFormat, data io.Reader) (st *dataset.Structure, n int, err error)

FromReader detects a dataset structure from a reader and data format, returning a detected dataset structure, the number of bytes read from the reader, and any error

func JSONSchema

func JSONSchema(resource *dataset.Structure, data io.Reader) (schema map[string]interface{}, n int, err error)

JSONSchema determines the field names and types of an io.Reader of JSON-formatted data, returning a json schema This is currently a suuuuuuuuper simple interpretation that spits out a generic schema that'll work. In the future we can do all sorts of stuff here to make better inferences about the shape of a dataset, but for now, this'll work, and we'll instead focus on making it easier for users to provide hand-built schemas

func Schema

func Schema(r *dataset.Structure, data io.Reader) (schema map[string]interface{}, n int, err error)

Schema determines the schema of a given reader for a given structure

func XLSXSchema

func XLSXSchema(r *dataset.Structure, data io.Reader) (schema map[string]interface{}, n int, err error)

XLSXSchema determines any schema information for an excel spreadsheet TODO (b5): currently unimplemented

Types

This section is empty.

Jump to

Keyboard shortcuts

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