archive

package module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 12 Imported by: 0

README

archive

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownArchiveFormat = errors.New("unknown archive format")

ErrUnknownArchiveFormat is error returned when file is not recognized as archive.

Functions

func Inflate

func Inflate(name string, reader io.Reader, path string) error

Inflate inflates stream based on file name.

func InflateTar

func InflateTar(reader io.Reader, path string) (retErr error)

InflateTar inflates tar archive.

func InflateTarGz

func InflateTarGz(reader io.Reader, path string) error

InflateTarGz inflates tar.gz archive.

func InflateTarXz

func InflateTarXz(reader io.Reader, path string) error

InflateTarXz inflates tar.xz archive.

func InflateZip

func InflateZip(reader io.Reader, path string) (retErr error)

InflateZip inflates zip archive.

Types

type HashingReader added in v0.3.0

type HashingReader struct {
	// contains filtered or unexported fields
}

HashingReader reads stream, computes and verifies checksum.

func NewHashingReader added in v0.3.0

func NewHashingReader(reader io.Reader, checksum string) (*HashingReader, error)

NewHashingReader creates new hashing reader.

func (*HashingReader) Read added in v0.3.0

func (hr *HashingReader) Read(p []byte) (int, error)

Read reads bytes from stream.

func (*HashingReader) ValidateChecksum added in v0.3.0

func (hr *HashingReader) ValidateChecksum() error

ValidateChecksum validates checksum. Before validating it reads all the remaining bytes from stream to ensure that checksum is computed from all bytes.

Jump to

Keyboard shortcuts

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