archiver

package
v0.0.0-...-affaa53 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedFormats = map[string]Archiver{}

SupportedFormats contains all supported archive formats

View Source
var Tar tarFormat

Tar is for Tar format

View Source
var TarGz tarGzFormat

TarGz is for TarGz format

Functions

func RegisterFormat

func RegisterFormat(name string, format Archiver)

RegisterFormat adds a supported archive format

Types

type Archiver

type Archiver interface {
	// Match checks supported files
	Match(filename string) bool
	// Make makes an archive file on disk.
	Make(destination string, sources []string) error
	// Open extracts an archive file on disk.
	Open(source, destination string) error
	// Write writes an archive to a Writer.
	Write(output io.Writer, sources []string) error
	// Read reads an archive from a Reader.
	Read(input io.Reader, destination string) error
}

Archiver represent a archive format

func MatchingFormat

func MatchingFormat(fpath string) Archiver

MatchingFormat returns the first archive format that matches the given file, or nil if there is no match

Jump to

Keyboard shortcuts

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