gf: github.com/gogf/gf/encoding/gcompress Index | Files

package gcompress

import "github.com/gogf/gf/encoding/gcompress"

Package gcompress provides kinds of compression algorithms for binary/bytes data.

Package gcompress provides kinds of compression algorithms for binary/bytes data.

Index

Package Files

gcompress.go gcompress_gzip.go gcompress_zip.go gcompress_zlib.go

func Gzip Uses

func Gzip(data []byte, level ...int) ([]byte, error)

Gzip compresses <data> using gzip algorithm. The optional parameter <level> specifies the compression level from 1 to 9 which means from none to the best compression.

Note that it returns error if given <level> is invalid.

func GzipFile Uses

func GzipFile(src, dst string, level ...int) error

GzipFile compresses the file <src> to <dst> using gzip algorithm.

func UnGzip Uses

func UnGzip(data []byte) ([]byte, error)

UnGzip decompresses <data> with gzip algorithm.

func UnGzipFile Uses

func UnGzipFile(src, dst string) error

UnGzip decompresses file <src> to <dst> using gzip algorithm.

func UnZipContent Uses

func UnZipContent(data []byte, dest string, path ...string) error

UnZipContent decompresses <data> to <dest> using zip compressing algorithm. The parameter <path> specifies the unzipped path of <archive>, which can be used to specify part of the archive file to unzip.

Note that the parameter <dest> should be a directory.

func UnZipFile Uses

func UnZipFile(archive, dest string, path ...string) error

UnZipFile decompresses <archive> to <dest> using zip compressing algorithm. The optional parameter <path> specifies the unzipped path of <archive>, which can be used to specify part of the archive file to unzip.

Note that the parameter <dest> should be a directory.

func UnZlib Uses

func UnZlib(data []byte) ([]byte, error)

UnZlib decompresses <data> with zlib algorithm.

func ZipPath Uses

func ZipPath(paths, dest string, prefix ...string) error

ZipPath compresses <paths> to <dest> using zip compressing algorithm. The unnecessary parameter <prefix> indicates the path prefix for zip file.

Note that the parameter <paths> can be either a directory or a file, which supports multiple paths join with ','.

func ZipPathWriter Uses

func ZipPathWriter(paths string, writer io.Writer, prefix ...string) error

ZipPathWriter compresses <paths> to <writer> using zip compressing algorithm. The unnecessary parameter <prefix> indicates the path prefix for zip file.

Note that the parameter <paths> can be either a directory or a file, which supports multiple paths join with ','.

func Zlib Uses

func Zlib(data []byte) ([]byte, error)

Zlib compresses <data> with zlib algorithm.

Package gcompress imports 11 packages (graph) and is imported by 3 packages. Updated 2020-10-25. Refresh now. Tools for package owners.