tar

package
v0.0.0-...-ee69469 Latest Latest
Warning

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

Go to latest
Published: May 5, 2016 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

This package provides convenience helpers on top of archive/tar to be able to tar/untar files with a functionality closer to gnu tar command.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindFile

func FindFile(tarFile io.Reader, filename string) (*tar.Header, io.Reader, error)

FindFile returns the header and ReadCloser for the entry in the tarfile that matches the filename. If nothing matches, an errors.NotFound error is returned.

func TarFiles

func TarFiles(fileList []string, target io.Writer, strip string) (shaSum string, err error)

TarFiles writes a tar stream into target holding the files listed in fileList. strip will be removed from the beginning of all the paths when stored (much like gnu tar -C option) Returns a Sha sum of the tar and nil if everything went well or empty sting and error in case of error. We use a base64 encoded sha1 hash, because this is the hash used by RFC 3230 Digest headers in http responses

func UntarFiles

func UntarFiles(tarFile io.Reader, outputFolder string) error

UntarFiles will extract the contents of tarFile using outputFolder as root

Types

This section is empty.

Jump to

Keyboard shortcuts

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