tar

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyToFile

func CopyToFile(tarReader *tar.Reader, fileName string, otherWriters ...io.Writer) error

func CreateArchiveFromFiles

func CreateArchiveFromFiles(wr io.Writer, files []*File) error

CreateArchiveFromFiles creates a tar archive from the given files and writes it into wr. On any non-nil error, the contents of wr will be undefined

Types

type ErrWritingHeader

type ErrWritingHeader struct {
	// contains filtered or unexported fields
}

func (ErrWritingHeader) Error

func (e ErrWritingHeader) Error() string

type File

type File struct {
	// contains filtered or unexported fields
}

File represents an on-disk file that can be written by a *tar.Writer, possibly as a different name, to a tar archive

func FilesFromRoot

func FilesFromRoot(root string, baseNames []string, joiner func(elts ...string) string) []*File

func NewFile

func NewFile(path, name string) *File

NewFile creates a new File struct that points to the file at path on disk. It will be written as name to a tar archive on subsequent successful calls to Write

func (*File) Name

func (d *File) Name() string

Name returns the name of the file as it will appear in a tar archive after a successful call to Write

func (*File) Path

func (d *File) Path() string

Path returns the path on disk of the file

func (*File) String

func (d *File) String() string

func (*File) Write

func (d *File) Write(tw *tar.Writer) error

Write opens the file, writes it to

Jump to

Keyboard shortcuts

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