archive

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package archive handles collections of files that are either packaged together or compressed.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoCustom no customization.
	ErrNoCustom = errors.New("does not support customization")
	// ErrNotArc not an archive.
	ErrNotArc = errors.New("format specified by source filename is not an archive format")
	// ErrSameArgs same same.
	ErrSameArgs = errors.New("name and dest cannot be the same")
	// ErrWalkrFmt cannot walk archive.
	ErrWalkrFmt = errors.New("format specified by archive filename is not a walker format")
)

Functions

func Compress added in v1.1.19

func Compress(files []string, buf io.Writer) (errs []error)

func Delete added in v1.1.19

func Delete(files []string) (errs []error)

func Extractor added in v1.1.31

func Extractor(source, filename, extract, destination string) error

Extractor extracts a file from the given archive file into the destination folder. The archive format is selected implicitly. Archiver relies on the filename extension to determine which decompression format to use, which must be supplied using filename.

func FileCopy

func FileCopy(name, dest string) (written int64, err error)

FileCopy copies a file to the destination.

func FileMove

func FileMove(name, dest string) (written int64, err error)

FileMove copies a file to the destination and then deletes the source.

func Proof added in v1.1.31

func Proof(archive, filename, uuid string) error

Proof decompresses and parses an archive. uuid is used to rename the extracted assets such as image previews.

func Read

func Read(uuid, filename string) (files []string, err error)

Read returns a list of files within an rar, tar, zip or 7z archive. uuid is the absolute path to the archive file named as a unique id. filename is the original archive filename and file extension.

func Readr

func Readr(archive, filename string) (files []string, err error)

Readr returns a list of files within an rar, tar or zip archive. It has offers compatibility with compression formats.

func Restore

func Restore(uuid, filename, destination string) (files []string, err error)

Restore unpacks or decompresses a given archive file to the destination. The archive format is selected implicitly. Restore relies on the filename extension to determine which decompression format to use, which must be supplied using filename. uuid is the absolute path to the archive file named as a unique id. filename is the original archive filename and file extension.

func Store added in v1.1.19

func Store(files []string, buf io.Writer) (errs []error)

func Unarchiver

func Unarchiver(source, filename, destination string) error

Unarchiver unarchives the given archive file into the destination folder. The archive format is selected implicitly. Archiver relies on the filename extension to determine which decompression format to use, which must be supplied using filename.

Types

type Demozoo

type Demozoo struct {
	DOSee string // dosee_run_program column
	NFO   string // retrotxt_readme column
}

Demozoo data extracted from an archive.

func ExtractDemozoo

func ExtractDemozoo(name, uuid string, varNames *[]string) (dz Demozoo, err error)

ExtractDemozoo decompresses and parses archives fetched from Demozoo.org.

func (Demozoo) String

func (d Demozoo) String() string

Jump to

Keyboard shortcuts

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