dsutil

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package dsutil includes dataset util funcs, placed here to avoid dataset package bloat TODO - consider merging this package with the dsfs package, as most of the functions in here rely on a Filestore argument

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormFileDataset

func FormFileDataset(r *http.Request, ds *dataset.Dataset) (err error)

FormFileDataset extracts a dataset document from a http Request

func UnmarshalYAMLDataset

func UnmarshalYAMLDataset(data []byte, ds *dataset.Dataset) error

UnmarshalYAMLDataset reads yaml bytes into a Dataset, dealing with the issue that YAML likes to unmarshal unknown values to map[interface{}]interface{} instead of map[string]interface{}

func UnzipDataset

func UnzipDataset(r io.ReaderAt, size int64, ds *dataset.Dataset) error

UnzipDataset reads a zip file from a filename and returns a full dataset with components

func UnzipDatasetBytes

func UnzipDatasetBytes(zipData []byte, ds *dataset.Dataset) error

UnzipDatasetBytes is a convenince wrapper for UnzipDataset

func UnzipGetContents

func UnzipGetContents(data []byte) (map[string]string, error)

UnzipGetContents is a generic zip-unpack to a map of filename: contents with contents represented as strings

func WriteDir

func WriteDir(store cafs.Filestore, ds *dataset.Dataset, path string) error

WriteDir loads a dataset & writes all contents to a directory specified by path

func WriteZipArchive

func WriteZipArchive(store cafs.Filestore, ds *dataset.Dataset, format string, ref string, w io.Writer) error

WriteZipArchive generates a zip archive of a dataset and writes it to w

Types

This section is empty.

Jump to

Keyboard shortcuts

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