compress

package
v0.0.97 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package compress provides the compress and uncompress functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSupport added in v0.0.49

func IsSupport(extension string) bool

IsSupport checks if the desired file extension

Types

type Bzip2 added in v0.0.49

type Bzip2 struct {
	// contains filtered or unexported fields
}

Bzip2 implements a compress which based is based on bzip2

func NewBzip2 added in v0.0.49

func NewBzip2(additionBinaries []string) *Bzip2

NewBzip2 creates an instance of Bzip2

func (*Bzip2) ExtractFiles added in v0.0.49

func (x *Bzip2) ExtractFiles(sourceFile, targetName string) (err error)

ExtractFiles extracts files from a target compress file

type Compress

type Compress interface {
	ExtractFiles(sourceFile, targetName string) error
}

Compress is a common compress interface

func GetCompressor added in v0.0.46

func GetCompressor(extension string, additionBinaries []string) Compress

GetCompressor gets the compressor base on file extension

type GZip

type GZip struct {
	// contains filtered or unexported fields
}

GZip implements a compress which based is based on gzip

func NewGZip

func NewGZip(additionBinaries []string) *GZip

NewGZip creates an instance of GZip additionBinaries could be empty or nil

func (*GZip) ExtractFiles

func (c *GZip) ExtractFiles(sourceFile, targetName string) (err error)

ExtractFiles extracts files from a target compress file

type Xz added in v0.0.45

type Xz struct {
	// contains filtered or unexported fields
}

Xz implements a compress which based is based on xz

func NewXz added in v0.0.45

func NewXz(additionBinaries []string) *Xz

NewXz creates an instance of Xz

func (*Xz) ExtractFiles added in v0.0.45

func (x *Xz) ExtractFiles(sourceFile, targetName string) (err error)

ExtractFiles extracts files from a target compress file

type Zip added in v0.0.46

type Zip struct {
	// contains filtered or unexported fields
}

Zip implements a compress which is base on zip file

func NewZip added in v0.0.46

func NewZip(additionBinaries []string) *Zip

NewZip creates an instance of zip

func (*Zip) ExtractFiles added in v0.0.46

func (z *Zip) ExtractFiles(sourceFile, targetName string) (err error)

ExtractFiles extracts files from a target compress file

Jump to

Keyboard shortcuts

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