Versions in this module Expand all Collapse all v3 v3.6.0 Jan 17, 2024 v3.5.3 Jan 4, 2024 Changes in this version + var DefaultBrotli = NewBrotli() + var DefaultBz2 = NewBz2() + var DefaultGz = NewGz() + var DefaultLz4 = NewLz4() + var DefaultRar = NewRar() + var DefaultSnappy = NewSnappy() + var DefaultTar = NewTar() + var DefaultTarBrotli = NewTarBrotli() + var DefaultTarBz2 = NewTarBz2() + var DefaultTarGz = NewTarGz() + var DefaultTarLz4 = NewTarLz4() + var DefaultTarSz = NewTarSz() + var DefaultTarXz = NewTarXz() + var DefaultTarZstd = NewTarZstd() + var DefaultXz = NewXz() + var DefaultZip = NewZip() + var DefaultZstd = NewZstd() + var ErrFormatNotRecognized = fmt.Errorf("format not recognized") + var ErrStopWalk = fmt.Errorf("walk stopped") + func Archive(sources []string, destination string) error + func ByExtension(filename string) (interface{}, error) + func CompressFile(source, destination string) error + func DecompressFile(source, destination string) error + func Extract(source, target, destination string) error + func IsIllegalPathError(err error) bool + func NameInArchive(sourceInfo os.FileInfo, source, fpath string) (string, error) + func Unarchive(source, destination string) error + func Walk(archive string, walkFn WalkFunc) error + type Archiver interface + Archive func(sources []string, destination string) error + type Brotli struct + Quality int + func NewBrotli() *Brotli + func (br *Brotli) CheckExt(filename string) error + func (br *Brotli) Compress(in io.Reader, out io.Writer) error + func (br *Brotli) Decompress(in io.Reader, out io.Writer) error + func (br *Brotli) String() string + type Bz2 struct + CompressionLevel int + func NewBz2() *Bz2 + func (bz *Bz2) CheckExt(filename string) error + func (bz *Bz2) Compress(in io.Reader, out io.Writer) error + func (bz *Bz2) Decompress(in io.Reader, out io.Writer) error + func (bz *Bz2) String() string + type Compressor interface + Compress func(in io.Reader, out io.Writer) error + type Decompressor interface + Decompress func(in io.Reader, out io.Writer) error + type ExtensionChecker interface + CheckExt func(name string) error + type Extractor interface + Extract func(source, target, destination string) error + type File struct + Header interface{} + type FileCompressor struct + OverwriteExisting bool + func (fc FileCompressor) CompressFile(source, destination string) error + func (fc FileCompressor) DecompressFile(source, destination string) error + type FileInfo struct + CustomName string + SourcePath string + func (fi FileInfo) Name() string + type FilenameChecker interface + CheckPath func(to, filename string) error + type Gz struct + CompressionLevel int + SingleThreaded bool + func NewGz() *Gz + func (gz *Gz) CheckExt(filename string) error + func (gz *Gz) Compress(in io.Reader, out io.Writer) error + func (gz *Gz) Decompress(in io.Reader, out io.Writer) error + func (gz *Gz) String() string + type IllegalPathError struct + AbsolutePath string + Filename string + func (err *IllegalPathError) Error() string + type Lz4 struct + CompressionLevel int + func NewLz4() *Lz4 + func (lz *Lz4) CheckExt(filename string) error + func (lz *Lz4) Compress(in io.Reader, out io.Writer) error + func (lz *Lz4) Decompress(in io.Reader, out io.Writer) error + func (lz *Lz4) String() string + type Matcher interface + Match func(io.ReadSeeker) (bool, error) + type Rar struct + ContinueOnError bool + ImplicitTopLevelFolder bool + MkdirAll bool + OverwriteExisting bool + Password string + StripComponents int + func NewRar() *Rar + func (*Rar) CheckExt(filename string) error + func (*Rar) CheckPath(to, filename string) error + func (*Rar) Match(file io.ReadSeeker) (bool, error) + func (r *Rar) Close() error + func (r *Rar) Extract(source, target, destination string) error + func (r *Rar) Open(in io.Reader, size int64) error + func (r *Rar) OpenFile(filename string) error + func (r *Rar) Read() (File, error) + func (r *Rar) String() string + func (r *Rar) Unarchive(source, destination string) error + func (r *Rar) Walk(archive string, walkFn WalkFunc) error + type ReadFakeCloser struct + func (rfc ReadFakeCloser) Close() error + type Reader interface + Close func() error + Open func(in io.Reader, size int64) error + Read func() (File, error) + type Snappy struct + func NewSnappy() *Snappy + func (s *Snappy) CheckExt(filename string) error + func (s *Snappy) Compress(in io.Reader, out io.Writer) error + func (s *Snappy) Decompress(in io.Reader, out io.Writer) error + func (s *Snappy) String() string + type Tar struct + ContinueOnError bool + ImplicitTopLevelFolder bool + MkdirAll bool + OverwriteExisting bool + StripComponents int + func NewTar() *Tar + func (*Tar) CheckExt(filename string) error + func (*Tar) CheckPath(to, filename string) error + func (*Tar) Match(file io.ReadSeeker) (bool, error) + func (t *Tar) Archive(sources []string, destination string) error + func (t *Tar) Close() error + func (t *Tar) Create(out io.Writer) error + func (t *Tar) Extract(source, target, destination string) error + func (t *Tar) Open(in io.Reader, size int64) error + func (t *Tar) Read() (File, error) + func (t *Tar) String() string + func (t *Tar) Unarchive(source, destination string) error + func (t *Tar) Walk(archive string, walkFn WalkFunc) error + func (t *Tar) Write(f File) error + type TarBrotli struct + Quality int + func NewTarBrotli() *TarBrotli + func (*TarBrotli) CheckExt(filename string) error + func (tbr *TarBrotli) Archive(sources []string, destination string) error + func (tbr *TarBrotli) Create(out io.Writer) error + func (tbr *TarBrotli) Extract(source, target, destination string) error + func (tbr *TarBrotli) Open(in io.Reader, size int64) error + func (tbr *TarBrotli) String() string + func (tbr *TarBrotli) Unarchive(source, destination string) error + func (tbr *TarBrotli) Walk(archive string, walkFn WalkFunc) error + type TarBz2 struct + CompressionLevel int + func NewTarBz2() *TarBz2 + func (*TarBz2) CheckExt(filename string) error + func (tbz2 *TarBz2) Archive(sources []string, destination string) error + func (tbz2 *TarBz2) Create(out io.Writer) error + func (tbz2 *TarBz2) Extract(source, target, destination string) error + func (tbz2 *TarBz2) Open(in io.Reader, size int64) error + func (tbz2 *TarBz2) String() string + func (tbz2 *TarBz2) Unarchive(source, destination string) error + func (tbz2 *TarBz2) Walk(archive string, walkFn WalkFunc) error + type TarGz struct + CompressionLevel int + SingleThreaded bool + func NewTarGz() *TarGz + func (*TarGz) CheckExt(filename string) error + func (tgz *TarGz) Archive(sources []string, destination string) error + func (tgz *TarGz) Create(out io.Writer) error + func (tgz *TarGz) Extract(source, target, destination string) error + func (tgz *TarGz) Open(in io.Reader, size int64) error + func (tgz *TarGz) String() string + func (tgz *TarGz) Unarchive(source, destination string) error + func (tgz *TarGz) Walk(archive string, walkFn WalkFunc) error + type TarLz4 struct + CompressionLevel int + func NewTarLz4() *TarLz4 + func (*TarLz4) CheckExt(filename string) error + func (tlz4 *TarLz4) Archive(sources []string, destination string) error + func (tlz4 *TarLz4) Create(out io.Writer) error + func (tlz4 *TarLz4) Extract(source, target, destination string) error + func (tlz4 *TarLz4) Open(in io.Reader, size int64) error + func (tlz4 *TarLz4) String() string + func (tlz4 *TarLz4) Unarchive(source, destination string) error + func (tlz4 *TarLz4) Walk(archive string, walkFn WalkFunc) error + type TarSz struct + func NewTarSz() *TarSz + func (*TarSz) CheckExt(filename string) error + func (tsz *TarSz) Archive(sources []string, destination string) error + func (tsz *TarSz) Create(out io.Writer) error + func (tsz *TarSz) Extract(source, target, destination string) error + func (tsz *TarSz) Open(in io.Reader, size int64) error + func (tsz *TarSz) String() string + func (tsz *TarSz) Unarchive(source, destination string) error + func (tsz *TarSz) Walk(archive string, walkFn WalkFunc) error + type TarXz struct + func NewTarXz() *TarXz + func (*TarXz) CheckExt(filename string) error + func (txz *TarXz) Archive(sources []string, destination string) error + func (txz *TarXz) Create(out io.Writer) error + func (txz *TarXz) Extract(source, target, destination string) error + func (txz *TarXz) Open(in io.Reader, size int64) error + func (txz *TarXz) String() string + func (txz *TarXz) Unarchive(source, destination string) error + func (txz *TarXz) Walk(archive string, walkFn WalkFunc) error + type TarZstd struct + func NewTarZstd() *TarZstd + func (*TarZstd) CheckExt(filename string) error + func (tzst *TarZstd) Archive(sources []string, destination string) error + func (tzst *TarZstd) Create(out io.Writer) error + func (tzst *TarZstd) Extract(source, target, destination string) error + func (tzst *TarZstd) Open(in io.Reader, size int64) error + func (tzst *TarZstd) String() string + func (tzst *TarZstd) Unarchive(source, destination string) error + func (tzst *TarZstd) Walk(archive string, walkFn WalkFunc) error + type Unarchiver interface + Unarchive func(source, destination string) error + func ByHeader(input io.ReadSeeker) (Unarchiver, error) + type WalkFunc func(f File) error + type Walker interface + Walk func(archive string, walkFn WalkFunc) error + type Writer interface + Close func() error + Create func(out io.Writer) error + Write func(f File) error + type Xz struct + func NewXz() *Xz + func (x *Xz) CheckExt(filename string) error + func (x *Xz) Compress(in io.Reader, out io.Writer) error + func (x *Xz) Decompress(in io.Reader, out io.Writer) error + func (x *Xz) String() string + type Zip struct + CompressionLevel int + ContinueOnError bool + FileMethod ZipCompressionMethod + ImplicitTopLevelFolder bool + MkdirAll bool + OverwriteExisting bool + SelectiveCompression bool + StripComponents int + func NewZip() *Zip + func (*Zip) CheckExt(filename string) error + func (*Zip) CheckPath(to, filename string) error + func (*Zip) Match(file io.ReadSeeker) (bool, error) + func (z *Zip) Archive(sources []string, destination string) error + func (z *Zip) Close() error + func (z *Zip) Create(out io.Writer) error + func (z *Zip) Extract(source, target, destination string) error + func (z *Zip) Open(in io.Reader, size int64) error + func (z *Zip) Read() (File, error) + func (z *Zip) String() string + func (z *Zip) Unarchive(source, destination string) error + func (z *Zip) Walk(archive string, walkFn WalkFunc) error + func (z *Zip) Write(f File) error + type ZipCompressionMethod uint16 + const BZIP2 + const Deflate + const LZMA + const Store + const XZ + const ZSTD + type Zstd struct + DecoderOptions []zstd.DOption + EncoderOptions []zstd.EOption + func NewZstd() *Zstd + func (zs *Zstd) CheckExt(filename string) error + func (zs *Zstd) Compress(in io.Reader, out io.Writer) error + func (zs *Zstd) Decompress(in io.Reader, out io.Writer) error + func (zs *Zstd) String() string