zip

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrDuplicateZipPath = "zip.duplicate_zip_path"
)

Variables

This section is empty.

Functions

func ErrorDuplicateZipPath added in v0.4.0

func ErrorDuplicateZipPath(path string) error

func ToFile

func ToFile(zipInput *Input, destPath string) error

func ToMem

func ToMem(zipInput *Input) ([]byte, error)

func ToWriter

func ToWriter(zipInput *Input, writer io.Writer) error

func UnzipFileToDir added in v0.16.0

func UnzipFileToDir(src string, destPath string) ([]string, error)

func UnzipFileToMem

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

func UnzipMemToMem

func UnzipMemToMem(zipBytes []byte) (map[string][]byte, 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