archive

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 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 PickFiles added in v0.2.0

func PickFiles(src, dest string, pick map[string]string) error

PickFiles moves files from source to destination. Filename matches use 'HasSuffix'. '*' is all files.

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 from 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 from source to destination.

Jump to

Keyboard shortcuts

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