sevenzip

package
v0.0.0-...-ee163f1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Err7zNotAvailable is returned if 7z executable is not available
	Err7zNotAvailable = errors.New("7z executable not available")

	// ErrNoEntries is returned if the archive has no files
	ErrNoEntries = errors.New("no entries in 7z file")
)

Functions

func Change7zCached

func Change7zCached(i int)

Types

type Archive

type Archive struct {
	Path    string
	Entries []Entry
	// contains filtered or unexported fields
}

Archive describes a single .7z archive

func NewArchive

func NewArchive(path string) (*Archive, error)

func NewEncryptedArchive

func NewEncryptedArchive(path string, password string) (*Archive, error)

func (*Archive) ExtractToFile

func (a *Archive) ExtractToFile(dstPath string, name string) error

ExtractToFile extracts a given file from the archive to a file on disk

func (*Archive) ExtractToWriter

func (a *Archive) ExtractToWriter(dst io.Writer, name string) error

ExtractToWriter writes the content of a given file inside the archive to dst

func (*Archive) GetFileReader

func (a *Archive) GetFileReader(name string) (io.ReadCloser, error)

GetFileReader returns a reader for reading a given file

type Entry

type Entry struct {
	Path       string
	Size       int64
	PackedSize int64 // -1 means "size unknown"
	Modified   time.Time
	Attributes string
	CRC        string
	Encrypted  string
	Method     string
	Block      int
}

Entry describes a single file inside .7z archive

Jump to

Keyboard shortcuts

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