archive

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const FileExtension = ".tar.gz"

Variables

View Source
var (
	ErrExtractFailed = errors.New("extract failed")
	ErrMissingInput  = errors.New("missing input")
)

Functions

func Create

func Create(files []string, out string) error

Create writes the provided files to a compressed archive at 'out'. The implementation follows from https://www.arthurkoziel.com/writing-tar-gz-files-in-go/.

NOTE: This implementation does *not* preserve directory structure. Files are placed side-by-side within the archive.

func Extract

func Extract(ctx context.Context, archive, out string) error

Extract uncompresses the files within the archive at 'archive' and copies them to the directory 'out'.

Types

This section is empty.

Jump to

Keyboard shortcuts

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