decompress

package
v0.0.0-...-c4986e2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFormat = errors.New("decompress: unknown format")

ErrFormat is unsupported format error

Functions

func RegisterFormat

func RegisterFormat(magic string, offset int, d Decompressor)

RegisterFormat registers decompressor for the magic number.

Types

type Decompressor

type Decompressor func(*os.File) (MultiPartFile, error)

Decompressor creates a reader form the file parameter

type Entry

type Entry struct {
	Reader io.Reader
	Header string
	IsDir  bool
	Mode   os.FileMode
}

Entry represents basic compressed file within archive.

type MultiPartFile

type MultiPartFile interface {
	Next() (*Entry, error)
}

MultiPartFile describes minimal interface for interating over compressed files. Using the similar approach as for tar module.

func NewReader

func NewReader(file *os.File) (MultiPartFile, error)

NewReader creates a decompressing reader.

type Signature

type Signature struct {
	Magic  string
	Offset int
}

Signature contains the magic string and the offset for look up.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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