archive

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrDuplicatePath = "archive.duplicate_path"
)

Variables

This section is empty.

Functions

func ErrorDuplicatePath

func ErrorDuplicatePath(path string) error

func TarToFile

func TarToFile(input *Input, destDir string) (strset.Set, error)

func TarToMem

func TarToMem(input *Input) ([]byte, strset.Set, error)

func TarToWriter

func TarToWriter(input *Input, writer io.Writer) (strset.Set, error)

func TgzToFile

func TgzToFile(input *Input, destDir string) (strset.Set, error)

func TgzToMem

func TgzToMem(input *Input) ([]byte, strset.Set, error)

func TgzToWriter

func TgzToWriter(input *Input, writer io.Writer) (strset.Set, error)

func UntarFileToDir

func UntarFileToDir(src string, destDir string) (strset.Set, error)

Will create destDir if missing

func UntarFileToMem

func UntarFileToMem(src string) (map[string][]byte, error)

func UntarMemToMem

func UntarMemToMem(tarBytes []byte) (map[string][]byte, error)

func UntarReaderToDir

func UntarReaderToDir(reader io.Reader, destDir string) (strset.Set, error)

Will create destDir if missing

func UntarReaderToMem

func UntarReaderToMem(reader io.Reader) (map[string][]byte, error)

func UntgzFileToDir

func UntgzFileToDir(src string, destDir string) (strset.Set, error)

Will create destDir if missing

func UntgzFileToMem

func UntgzFileToMem(src string) (map[string][]byte, error)

func UntgzMemToMem

func UntgzMemToMem(tgzBytes []byte) (map[string][]byte, error)

func UntgzReaderToDir

func UntgzReaderToDir(reader io.Reader, destDir string) (strset.Set, error)

Will create destDir if missing

func UntgzReaderToMem

func UntgzReaderToMem(reader io.Reader) (map[string][]byte, error)

func UnzipFileToDir

func UnzipFileToDir(src string, destDir string) (strset.Set, error)

Will create destDir if missing

func UnzipFileToMem

func UnzipFileToMem(src string) (map[string][]byte, error)

func UnzipMemToMem

func UnzipMemToMem(zipBytes []byte) (map[string][]byte, error)

func ZipToFile

func ZipToFile(input *Input, destDir string) (strset.Set, error)

func ZipToMem

func ZipToMem(input *Input) ([]byte, strset.Set, error)

func ZipToWriter

func ZipToWriter(input *Input, writer io.Writer) (strset.Set, error)

Types

type BytesInput

type BytesInput struct {
	Content []byte
	Dest    string
}

type DirInput

type DirInput struct {
	Source             string
	Dest               string
	IgnoreFns          []files.IgnoreFn
	Flatten            bool
	RemovePrefix       string
	RemoveCommonPrefix bool
}

type FileInput

type FileInput struct {
	Source string
	Dest   string
}

type FileListInput

type FileListInput struct {
	Sources            []string
	Dest               string
	Flatten            bool
	RemovePrefix       string
	RemoveCommonPrefix bool
}

type Input

type Input struct {
	Files          []FileInput
	Bytes          []BytesInput
	Dirs           []DirInput
	FileLists      []FileListInput
	AddPrefix      string   // Gets added to every item
	EmptyFiles     []string // Empty files to be created
	AllowOverwrite bool     // Don't error if a file in the zip is overwritten
}

Jump to

Keyboard shortcuts

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