tarfs

package
v0.0.0-...-ffa36f7 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Header tar.Header
	Offset int64

	Filename string
	// contains filtered or unexported fields
}

func Index

func Index(r io.Reader) ([]*Entry, error)

Index returns a list of tar entries with their offsets.

This is primarily useful if you don't have an io.ReaderAt implementation handy but still want to know the offsets, for example if you're using something like: https://pkg.go.dev/cloud.google.com/go/storage#ObjectHandle.NewRangeReader

func (Entry) Info

func (e Entry) Info() (fs.FileInfo, error)

func (Entry) IsDir

func (e Entry) IsDir() bool

func (Entry) Name

func (e Entry) Name() string

func (Entry) Size

func (e Entry) Size() int64

func (Entry) Type

func (e Entry) Type() fs.FileMode

type FS

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

func Decode

func Decode(ra io.ReaderAt, r io.Reader) (*FS, error)

func New

func New(ra io.ReaderAt, size int64) (*FS, error)

func (*FS) Encode

func (fsys *FS) Encode(w io.Writer) error

func (*FS) Entry

func (fsys *FS) Entry(name string) (*Entry, error)

func (*FS) Lstat

func (fsys *FS) Lstat(name string) (fs.FileInfo, error)

func (*FS) Open

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

Open implements fs.FS.

func (*FS) ReadDir

func (fsys *FS) ReadDir(name string) ([]fs.DirEntry, error)
func (fsys *FS) ReadLink(name string) (string, error)
func (fsys *FS) Readlink(name string) (string, error)

Readlink is kept for backwards compatibility for code written prior to fs.ReadLinkFS.

func (*FS) Stat

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

type File

type File struct {
	Entry *Entry
	// contains filtered or unexported fields
}

func (*File) Close

func (f *File) Close() error

func (*File) Read

func (f *File) Read(p []byte) (int, error)

func (*File) ReadAt

func (f *File) ReadAt(p []byte, off int64) (int, error)

func (*File) ReadDir

func (f *File) ReadDir(n int) ([]fs.DirEntry, error)

func (*File) Seek

func (f *File) Seek(offset int64, whence int) (int64, error)

func (*File) Stat

func (f *File) Stat() (fs.FileInfo, error)

type TOC

type TOC struct {
	Entries []*Entry
}

Jump to

Keyboard shortcuts

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