archiver

package
v0.0.0-...-189a019 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: MIT Imports: 17 Imported by: 17

Documentation

Index

Constants

View Source
const (
	// ModeMask is or'd with files walked by butler
	ModeMask = 0666

	// LuckyMode is used when wiping in last-chance mode
	LuckyMode = 0777

	// DirMode is the default mode for directories created by butler
	DirMode = 0755
)

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(filename string, mode os.FileMode, fileReader io.Reader) error

func Mkdir

func Mkdir(dstpath string) error
func Symlink(linkname string, filename string, consumer *state.Consumer) error

Types

type CompressResult

type CompressResult struct {
	UncompressedSize int64
	CompressedSize   int64
}

func CompressTar

func CompressTar(archiveWriter io.Writer, dir string, consumer *state.Consumer) (*CompressResult, error)

func CompressZip

func CompressZip(archiveWriter io.Writer, dir string, consumer *state.Consumer) (*CompressResult, error)

type EntryDoneFunc

type EntryDoneFunc func(slashPath string)

type ExtractResult

type ExtractResult struct {
	Dirs     int
	Files    int
	Symlinks int
}

func Extract

func Extract(readerAt io.ReaderAt, size int64, destPath string, settings ExtractSettings) (*ExtractResult, error)

func ExtractPath

func ExtractPath(archive string, destPath string, settings ExtractSettings) (*ExtractResult, error)

func ExtractTar

func ExtractTar(archive string, dir string, settings ExtractSettings) (*ExtractResult, error)

Does not preserve users, nor permission, except the executable bit

func ExtractZip

func ExtractZip(readerAt io.ReaderAt, size int64, dir string, settings ExtractSettings) (*ExtractResult, error)

type ExtractSettings

type ExtractSettings struct {
	Consumer                *state.Consumer
	ResumeFrom              string
	OnUncompressedSizeKnown UncompressedSizeKnownFunc
	OnEntryDone             EntryDoneFunc
	DryRun                  bool
	Concurrency             int
}

type UncompressedSizeKnownFunc

type UncompressedSizeKnownFunc func(uncompressedSize int64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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