dsutil

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: GPL-3.0 Imports: 19 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 InlineScriptsToBytes added in v0.9.5

func InlineScriptsToBytes(ds *dataset.Dataset) error

InlineScriptsToBytes consumes all open script files for dataset components other than the body, inlining file data to scriptBytes fields

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(ctx context.Context, 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(ctx context.Context, 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