archives

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArchivalMap = map[string]archives.Archival{
	"tar": archives.Tar{},
	"zip": archives.Zip{},
}

maps to handle archival types

View Source
var CompressionMap = map[string]archives.Compression{
	"gz":  archives.Gz{},
	"bz2": archives.Bz2{},
	"xz":  archives.Xz{},
	"zst": archives.Zstd{},
	"lz4": archives.Lz4{},
	"br":  archives.Brotli{},
}

maps to handle compression types

Functions

func Archive

func Archive(ctx context.Context, dir, outfile string, compression archives.Compression, archival archives.Archival) error

archives the files in a directory dir: the directory to Archive outfile: the output file compression: the compression to use (gzip, bzip2, etc.) archival: the archival to use (tar, zip, etc.)

func Unarchive

func Unarchive(ctx context.Context, tarball, dst string) error

unarchives a tarball to a directory, symlinks, and hardlinks are ignored

Types

This section is empty.

Jump to

Keyboard shortcuts

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