archive

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 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 support file")
)

Functions

func Unarchive

func Unarchive(src, dest string) error

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

Types

type TGz

type TGz struct{}

TGz unarchives tar.gz(tgz) archive file.

func (TGz) Unarchive

func (t TGz) Unarchive(src, dest string) error

Unarchive unpacks the .tar.gz(.tgz) file at source to destination.

type Unarchiver

type Unarchiver interface {
	Unarchive(src, dest string) error
}

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

func NewUnarchiver

func NewUnarchiver(path string) (Unarchiver, error)

NewUnarchiver creates an unpacker that can extract archive files into a folder. The archive format is selected implicitly.

type Zip

type Zip struct{}

Zip unarchives zip archive file.

func (Zip) Unarchive

func (z Zip) Unarchive(src, dest 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