archive_reader

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveReader

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

ArchiveReader provides a way to only read some selected files from either a .zip or .tar.gz archive

func New

func New(archive string) (*ArchiveReader, error)

create a new archiveReader from the given archive (either a .zip or .tar.gz file)

func (*ArchiveReader) Close

func (ar *ArchiveReader) Close() error

close the archiveReader and all it's resources

func (*ArchiveReader) GetElementFunc

func (ar *ArchiveReader) GetElementFunc(fn func(string) bool) (io.ReadCloser, bool, uint64, error)

returns a file-like reader, wether the file is a directory the size of that file for the first path that satisfies fn

func (*ArchiveReader) IterateElementsFunc

func (ar *ArchiveReader) IterateElementsFunc(fn func(string, bool, io.Reader, uint64) error) error

allows iteration over all elements in the archive fn is called on each element and should and error occur that error is returned

Jump to

Keyboard shortcuts

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