archiver

package
v0.0.0-...-9981174 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileArchiver

type FileArchiver struct {
	*os.File
	// contains filtered or unexported fields
}

func NewFileArchiver

func NewFileArchiver(path, archivePath string) *FileArchiver

NewFileArchiver creates fileArchiver used for storing plain files inside tar archive. path is the absolute path to the file that will be archived and archivePath is the relatve path inside the archive (see tar.Header.Name)

func (*FileArchiver) Archive

func (f *FileArchiver) Archive(tw *tar.Writer) error

type StreamArchiver

type StreamArchiver struct {
	*bytes.Reader
	// contains filtered or unexported fields
}

func NewMetadataArchiver

func NewMetadataArchiver(data metadata.WriteValidator, archivePath string) *StreamArchiver

NewMetadataArchiver creates streamArchiver used for storing metadata elements inside tar archive. data is the data structure implementing Validater interface and must be a struct that can be converted to JSON (see getJSON below) archivePath is the relatve path inside the archive (see tar.Header.Name)

func NewStreamArchiver

func NewStreamArchiver(data []byte, archivePath string) *StreamArchiver

NewStreamArchiver creates streamArchiver used for storing plain text files inside tar archive. data is the plain data that will be stored in archive file archivePath is the relatve path inside the archive (see tar.Header.Name)

func (*StreamArchiver) Archive

func (str *StreamArchiver) Archive(tw *tar.Writer) error

Jump to

Keyboard shortcuts

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