archive

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnrecognizedArchiveType = errors.New("Unrecognized archive type")
)

Functions

func CleanFileName

func CleanFileName(fileName string) string

Types

type ArchiveInfo

type ArchiveInfo struct {
	Strategy ArchiveStrategy
	Features savior.ExtractorFeatures
}

func Probe

func Probe(params *TryOpenParams) (*ArchiveInfo, error)

func (*ArchiveInfo) GetExtractor

func (ai *ArchiveInfo) GetExtractor(file eos.File, consumer *state.Consumer) (savior.Extractor, error)

type ArchiveStrategy

type ArchiveStrategy int
const (
	ArchiveStrategyNone ArchiveStrategy = 0

	ArchiveStrategyZip ArchiveStrategy = 100

	ArchiveStrategyTar    ArchiveStrategy = 200
	ArchiveStrategyTarGz  ArchiveStrategy = 201
	ArchiveStrategyTarBz2 ArchiveStrategy = 202

	ArchiveStrategySevenZip ArchiveStrategy = 300
)

type Contents

type Contents struct {
	Entries []*Entry
}

type Entry

type Entry struct {
	Name             string
	UncompressedSize int64
}

Entry refers to a file entry in an archive

type ExtractParams

type ExtractParams struct {
	File       eos.File
	StagePath  string
	OutputPath string

	Consumer *state.Consumer

	Load LoadFunc
	Save SaveFunc
}

type LoadFunc

type LoadFunc func(state interface{}) error

type SaveFunc

type SaveFunc func(state interface{}) error

type ThrottledSaveFunc

type ThrottledSaveFunc func(state interface{}, force bool) bool

Saves the state if force is true or the interval has passed Returns true if the state was actually saved, false if not

func ThrottledSave

func ThrottledSave(params *ExtractParams) ThrottledSaveFunc

type TryOpenParams

type TryOpenParams struct {
	File     eos.File
	Consumer *state.Consumer
}

Directories

Path Synopsis
formulas
Code generated by go generate; DO NOT EDIT.
Code generated by go generate; DO NOT EDIT.

Jump to

Keyboard shortcuts

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