archivehelpers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archiver

type Archiver interface {
	Extracter

	// ArchiveDirectory archives the given directory into the given output stream
	// for all files matching predicate.
	// out is closed by this method.
	ArchiveDirectory(directory string, predicate func(string) bool, out io.WriteCloser) error
}

Archiver is an interface for archiving files and directories.

func New

func New(typ Type) (Archiver, error)

New returns a new Archiver for the given type.

type Extracter

type Extracter interface {
	// Extract extracts the given archive into the given directory.
	Extract(in io.ReadCloser, targetDir string) error
}

Extracter is an interface for extracting archives.

type Type

type Type int

Type represents an archive type.

const (
	// TypeUnknown is the default value for an unknown type.
	TypeUnknown Type = iota
	// TypeTarGz is a tar.gz archive.
	TypeTarGz
)

func (Type) String

func (t Type) String() string

Jump to

Keyboard shortcuts

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