Documentation ¶
Index ¶
- type ZipHelper
- func (instance *ZipHelper) AddFileToZip(zipWriter *zip.Writer, filename string) error
- func (instance *ZipHelper) GUnzip(data []byte) (response []byte, err error)
- func (instance *ZipHelper) GZip(data []byte) (response []byte, err error)
- func (instance *ZipHelper) Unzip(src string, dest string) (filenames []string, err error)
- func (instance *ZipHelper) ZipFiles(filename string, files []string) (err error)
- func (instance *ZipHelper) ZipFilesFromRoot(filename string, files []string, root string) (err error)
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 ¶
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) Unzip ¶
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 ¶
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.