tmpfs

package
v0.0.0-...-d6d534c Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Archive

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

Archive contains the directories and files from a decompressed archive

func ReadImage

func ReadImage(r io.Reader) *Archive

ReadImage reads a compressed tar to produce a file hierarchy

func (*Archive) DumpArchive

func (a *Archive) DumpArchive()

DumpArchive will write out the archive hierarchy

func (*Archive) DumpEntry

func (a *Archive) DumpEntry(e Entry, parentPath string)

DumpEntry will write out the archive hierarchy from the given entry and parentPath

func (*Archive) Root

func (a *Archive) Root() *Directory

Root returns the root directory for the archive

type Directory

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

Directory describes a directory from a tar

func (*Directory) Child

func (d *Directory) Child(i int) Entry

Child looks up the child in the given directory by index

func (*Directory) ChildByName

func (d *Directory) ChildByName(name string) (Entry, bool)

ChildByName looks up the child in the given directory by name

func (*Directory) Name

func (d *Directory) Name() string

Name of the directory (no path)

func (*Directory) NumChildren

func (d *Directory) NumChildren() int

NumChildren returns the number of children in this directory

func (*Directory) P9Dir

func (d *Directory) P9Dir(uname string) *protocol.Dir

P9Dir generates the Dir message for this directory

func (*Directory) Parent

func (d *Directory) Parent() Entry

Parent returns the parent entry

func (*Directory) Qid

func (d *Directory) Qid() protocol.QID

Qid returns the Qid for this directory

type Entry

type Entry interface {
	Name() string

	// p9 server qid
	Qid() protocol.QID

	// p9 dir structure (stat)
	P9Dir(uname string) *protocol.Dir
}

Entry is a common interface for file and directorys

type File

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

File describes a file from a tar archive

func (*File) Data

func (f *File) Data() []byte

Data returns the data for the given file

func (*File) Name

func (f *File) Name() string

Name of the file (no path)

func (*File) P9Dir

func (f *File) P9Dir(uname string) *protocol.Dir

P9Dir generates the Dir message for this file

func (*File) Qid

func (f *File) Qid() protocol.QID

Qid for file

Jump to

Keyboard shortcuts

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