gg_zip

package
v0.2.100 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZipHelper

type ZipHelper struct {
}
var Zip *ZipHelper

func (*ZipHelper) AddFileToZip

func (instance *ZipHelper) AddFileToZip(zipWriter *zip.Writer, filename string) error

AddFileToZip adds a file to an existing zip archive. Param 1: zipWriter is the writer for the zip archive. Param 2: filename is the name of the file to be added to the zip.

func (*ZipHelper) GUnzip

func (instance *ZipHelper) GUnzip(data []byte) (response []byte, err error)

func (*ZipHelper) GZip

func (instance *ZipHelper) GZip(data []byte) (response []byte, err error)

func (*ZipHelper) Unzip

func (instance *ZipHelper) Unzip(src string, dest string) (filenames []string, err error)

Unzip extracts files from a zip archive. Param 1: src is the source zip file's path. Param 2: dest is the destination directory to extract files to. Returns: a slice of filenames that were extracted and any encountered error.

func (*ZipHelper) ZipFiles

func (instance *ZipHelper) ZipFiles(filename string, files []string) (err error)

ZipFiles compresses one or many files into a single zip archive file. Param 1: filename is the output zip file's name. Param 2: files is a list of files to add to the zip.

func (*ZipHelper) ZipFilesFromRoot

func (instance *ZipHelper) ZipFilesFromRoot(filename string, files []string, root string) (err error)

ZipFilesFromRoot compresses multiple files into a single zip archive file from a specified root directory. Root path is not preserved. Param 1: filename is the name of the output zip archive file. Param 2: files is a slice of file paths to include in the zip archive. Param 3: root denotes the root directory to be removed from the zip archive.

Jump to

Keyboard shortcuts

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