Documentation
¶
Overview ¶
Package tarfs provides a read-only file system interface to tar archives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirEntry ¶
type DirEntry struct {
// contains filtered or unexported fields
}
DirEntry represents a directory entry in a tar archive.
type File ¶
type File struct {
// contains filtered or unexported fields
}
File represents a file in a tar archive.
func (*File) FileInfo ¶
FileInfo returns the fs.FileInfo for the tar entry.
func (*File) ReadDir ¶
ReadDir implements fs.ReadDirFile for directories.
type TarFile ¶
type TarFile struct {
// contains filtered or unexported fields
}
TarFile represents a read-only file system backed by a tar archive. It will lazily buffer the contents of the tar archive as files are accessed.
Entries are accessed in order and cached as they are read, so random access may be inefficient.
func FromReader ¶
FromReader creates a new TarFile from an io.Reader containing a tar archive.
FromReader takes ownership of r, reading from it as needed. If r is an io.ReadCloser it will be closed when either [r.Read] returns an error or [Close] is called.
If r is not an io.ReadCloser, it will be wrapped in io.NopCloser.