archive

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package archive creates and consumes high-fidelity conversions of dataset documents for export & import

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

func Export(ctx context.Context, store cafs.Filestore, ds *dataset.Dataset, refStr, targetDir, output, outputFormat string, zipped bool) (string, error)

Export generates a high-fidelity copy of a dataset that doesn't require qri software to read. TODO (b5) - this currently has a lot of overlap with "get" and "checkout" commands, we should emphasize those (more common) tools instead. See https://github.com/qri-io/qri/issues/1176 for discussion

func GenerateFilename

func GenerateFilename(ds *dataset.Dataset, format string) (string, error)

GenerateFilename takes a dataset and generates a filename if no timestamp exists, it will default to the empty time.Time in the form [peername]-[datasetName]_-_[timestamp].[format]

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 WriteZip

func WriteZip(ctx context.Context, store cafs.Filestore, ds *dataset.Dataset, format, initID string, ref dsref.Ref, w io.Writer) error

WriteZip 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