archive

package
v0.0.0-...-96442b1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package archive provides functions to archive and unarchive files.

Index

Constants

This section is empty.

Variables

View Source
var ErrStopWalk = errors.New("stop walk")

ErrStopWalk can be returned in WalkTarXZArchive to stop walking

Functions

func TarXZExtractAll

func TarXZExtractAll(tarxzArchive string, destinationDir string) error

TarXZExtractAll extracts all regular files from the .tar.xz archive

func TarXZExtractFile

func TarXZExtractFile(tarxzArchive string, path string, destinationDir string) error

TarXZExtractFile extracts a single file at path from the provided archive

func Unzip

func Unzip(source, destination string) error

Unzip unpacks the .zip file at source to destination.

func WalkTarXZArchive

func WalkTarXZArchive(tarxzArchive string, walkFunc func(*tar.Reader, *tar.Header) error) error

WalkTarXZArchive walks the provided .tar.xz archive, calling walkFunc for each entry. If ErrStopWalk is returned from walkFunc, then the walk is stopped.

func Zip

func Zip(sources []string, destination string) error

Zip is an adapted implementation of (*Zip).Archive from https://github.com/mholt/archiver/blob/v3.5.1/zip.go#L140 Copyright (c) 2016 Matthew Holt

Types

This section is empty.

Jump to

Keyboard shortcuts

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