archive

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotSupportFile does not support file extensions.
	ErrNotSupportFile = errors.New("not supoort file extension")
)

Functions

func Support

func Support(fpath string) bool

Support check for handle the archive file format.

func Unarchive

func Unarchive(source, destination string) error

Unarchive unarchives the given archive file into the destination folder. The archive format is selected implicitly.

Types

type TarGz

type TarGz struct{}

TarGz unarchives tar.gz(tgz) archive file.

func (TarGz) Unarchive

func (t TarGz) Unarchive(source, destination string) error

Unarchive unpacks the .zip file at source to destination.

type Unarchiver

type Unarchiver interface {
	Unarchive(source, destination string) error
}

Unarchiver is a type that can extract archive files into a folder.

type Zip

type Zip struct{}

Zip unarchives zip archive file.

func (Zip) Unarchive

func (z Zip) Unarchive(source, destination string) error

Unarchive unpacks the .zip file at source to destination.

Jump to

Keyboard shortcuts

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