easyzip

package
v0.0.0-...-9488be8 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Zip

type Zip struct {
	// contains filtered or unexported fields
}

func NewZip

func NewZip(verbose bool) *Zip

create Zip instance, if verbose is true, it will print file name when archiving file to zip or extracting file from zip.

func (*Zip) Unzip

func (z *Zip) Unzip(src, dst string) error

unzip src to dst, if dst is empty, the contents will extract to current work directory, otherwise put into dst directory.

func (*Zip) ZipDir

func (z *Zip) ZipDir(src, dst string, overwrite, create_root bool) error

create a zip file from given directory. when overwrite enabled, it will delete dst first (if exist), or else return a dst already existed error. when create_root enabled, it will create a directory named src and put all contents into it.

func (*Zip) ZipFile

func (z *Zip) ZipFile(src []string, dst string, overwrite bool) error

create a zip file named `dst` from a list of items the items can be either files or directories. when overwrite is enabled, the dst will be delete first. when error occurred, it simply return that error, caller may delete `dst` manually.

Jump to

Keyboard shortcuts

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