Documentation ¶
Overview ¶
Package tarx implements access to tar archives on top of archive/tar.
Index ¶
- Variables
- func Compress(fileName, srcPath string, options *CompressOptions) error
- func Extract(fileName, targetDir string, options *ExtractOptions) error
- func Find(fileName, targetFileName string) (*tar.Header, io.ReadCloser, error)
- func List(fileName string) ([]*tar.Header, error)
- type CompressOptions
- type Compression
- type ExtractOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAppendNotSupported = errors.New("Append is only supported on compressed files") ErrBzip2NotSupported = errors.New("Bzip2 is not supported for compression") )
Common errors
Functions ¶
func Compress ¶
func Compress(fileName, srcPath string, options *CompressOptions) error
Compress compress a source path into a tar file. All files will be relative to the tar file.
func Extract ¶
func Extract(fileName, targetDir string, options *ExtractOptions) error
Extract extracts the files from a tar file into a target directory.
Types ¶
type CompressOptions ¶
type CompressOptions struct { Append bool Compression Compression IncludeSourceDir bool Filters []string }
CompressOptions is the compression configuration
type Compression ¶
type Compression int
Compression is the state represents if compressed or not.
const ( // Uncompressed represents the uncompressed. Uncompressed Compression = iota // Gzip is gzip compression algorithm. Gzip // Bzip2 is bzip2 compression algorithm. Bzip2 )
type ExtractOptions ¶
ExtractOptions is the decompression configuration
Click to show internal directories.
Click to hide internal directories.