tar

package
v0.5.61 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TarGz

type TarGz struct {
}

func (*TarGz) Create added in v0.5.53

func (tg *TarGz) Create(buf io.Writer, options *TarGzOptions, src []string, ignore ...string) error

Compress compresses the src directory into a tar.gz file optionally a list of globs to be ignored can be passed

func (*TarGz) Extract added in v0.5.53

func (tg *TarGz) Extract(src io.Reader, gziped bool, dst string) error

type TarGzOptions

type TarGzOptions struct {
	// OmitRoot when set to true ignores the top level directory in the tar archive
	// only adding sub directories and files.
	// /folder/foo/bar/test.txt -> /test.txt
	// /folder/foo/bar/baz/* -> /baz
	OmitRoot bool

	// ZipContents controlls if the contents of the tar is compressed
	ZipContents bool

	// StripFolder is like OmitRoot except all folder are removed and the file list is
	// flattened. Duplicate filenames will be overwritten
	StripFolders bool
}

Jump to

Keyboard shortcuts

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