-
Notifications
You must be signed in to change notification settings - Fork 3
/
zip.go
26 lines (20 loc) · 876 Bytes
/
zip.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package zipKit
import (
"github.com/gogf/gf/v2/encoding/gcompress"
"io"
)
func ZipPath(fileOrFolderPaths, dstFilePath string, prefix ...string) error {
return gcompress.ZipPath(fileOrFolderPaths, dstFilePath, prefix...)
}
func ZipPathContent(fileOrFolderPaths string, prefix ...string) ([]byte, error) {
return gcompress.ZipPathContent(fileOrFolderPaths, prefix...)
}
func ZipPathWriter(fileOrFolderPaths string, writer io.Writer, prefix ...string) error {
return gcompress.ZipPathWriter(fileOrFolderPaths, writer, prefix...)
}
func UnZipContent(zippedContent []byte, dstFolderPath string, zippedPrefix ...string) error {
return gcompress.UnZipContent(zippedContent, dstFolderPath, zippedPrefix...)
}
func UnZipFile(zippedFilePath, dstFolderPath string, zippedPrefix ...string) error {
return gcompress.UnZipFile(zippedFilePath, dstFolderPath, zippedPrefix...)
}