tarfs

package
v1.5.27 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Overview

Package tarfs implements the fs.FS interface over a tar archive.

Index

Constants

This section is empty.

Variables

View Source
var ErrFormat = errors.New("tarfs: format error reading file")

ErrFormat can be compared via errors.Is against errors reported by New to determine if the tar fail is considered well-formed.

Functions

This section is empty.

Types

type FS

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

FS implements a filesystem abstraction over an io.ReaderAt containing a tar.

func New

func New(r io.ReaderAt) (*FS, error)

New creates an FS from the tar contained in the ReaderAt.

The ReaderAt must remain valid for the entire life of the returned FS and any FSes returned by Sub.

func (*FS) Glob

func (f *FS) Glob(pat string) ([]string, error)

Glob implements fs.GlobFS.

See path.Match for the patten syntax.

func (*FS) Open

func (f *FS) Open(name string) (fs.File, error)

Open implements fs.FS.

func (*FS) ReadDir

func (f *FS) ReadDir(name string) ([]fs.DirEntry, error)

ReadDir implements fs.ReadDirFS.

func (*FS) ReadFile

func (f *FS) ReadFile(name string) ([]byte, error)

ReadFile implements fs.ReadFileFS.

func (*FS) Stat

func (f *FS) Stat(name string) (fs.FileInfo, error)

Stat implements fs.StatFS.

func (*FS) Sub

func (f *FS) Sub(dir string) (fs.FS, error)

Sub implements fs.SubFS.

Jump to

Keyboard shortcuts

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