archives

package
v0.0.0-...-5f25c38 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TarFileType

func TarFileType(typ byte) files.FileType

Types

type Archive

type Archive interface {
	Next() (files.File, error)
	ReadAll() ([]byte, error)
}

func NewTarArchive

func NewTarArchive(data []byte, decompress DecompressFunc) (Archive, error)

func NewZipArchive

func NewZipArchive(data []byte, _ DecompressFunc) (Archive, error)

decompressor does nothing for a zip archive because it already has built-in compression.

type ArchiveFunc

type ArchiveFunc func(data []byte, decomp DecompressFunc) (Archive, error)

type DecompressFunc

type DecompressFunc func(r io.Reader) (io.Reader, error)

type TarArchive

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

func (*TarArchive) Next

func (t *TarArchive) Next() (files.File, error)

func (*TarArchive) ReadAll

func (t *TarArchive) ReadAll() ([]byte, error)

type ZipArchive

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

func (*ZipArchive) Next

func (z *ZipArchive) Next() (files.File, error)

func (*ZipArchive) ReadAll

func (z *ZipArchive) ReadAll() ([]byte, error)

Jump to

Keyboard shortcuts

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