vfs

package
v0.4.5-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: ISC Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	Lname    string      `json:"Name" msgpack:"Name"`
	Lsize    int64       `json:"Size" msgpack:"Size"`
	Lmode    os.FileMode `json:"Mode" msgpack:"Mode"`
	LmodTime time.Time   `json:"ModTime" msgpack:"ModTime"`
	Ldev     uint64      `json:"Dev" msgpack:"Dev"`
	Lino     uint64      `json:"Ino" msgpack:"Ino"`
	Luid     uint64      `json:"Uid" msgpack:"Uid"`
	Lgid     uint64      `json:"Gid" msgpack:"Gid"`
}

func FileInfoFromStat

func FileInfoFromStat(stat os.FileInfo) FileInfo

func NewFileInfo

func NewFileInfo(name string, size int64, mode os.FileMode, modTime time.Time, dev uint64, ino uint64, uid uint64, gid uint64) FileInfo

func (FileInfo) Dev

func (f FileInfo) Dev() uint64

func (FileInfo) Gid

func (f FileInfo) Gid() uint64

func (*FileInfo) HumanSize

func (fileinfo *FileInfo) HumanSize() string

func (FileInfo) Ino

func (f FileInfo) Ino() uint64

func (FileInfo) IsDir

func (f FileInfo) IsDir() bool

func (FileInfo) ModTime

func (f FileInfo) ModTime() time.Time

func (FileInfo) Mode

func (f FileInfo) Mode() os.FileMode

func (FileInfo) Name

func (f FileInfo) Name() string

func (FileInfo) Size

func (f FileInfo) Size() int64

func (FileInfo) Sys

func (f FileInfo) Sys() any

func (FileInfo) Uid

func (f FileInfo) Uid() uint64

type Filesystem

type Filesystem struct {
	Root *FilesystemNode

	Inodes map[string]FileInfo

	Pathnames map[string]uint64

	Symlinks map[string]string
	// contains filtered or unexported fields
}

func NewFilesystem

func NewFilesystem() *Filesystem

func NewFilesystemFromBytes

func NewFilesystemFromBytes(serialized []byte) (*Filesystem, error)

func NewFilesystemFromScan

func NewFilesystemFromScan(repository string, directory string) (*Filesystem, error)

func (*Filesystem) GetPathname

func (filesystem *Filesystem) GetPathname(pathnameId uint64) string

func (*Filesystem) GetPathnameID

func (filesystem *Filesystem) GetPathnameID(pathname string) uint64

func (*Filesystem) ImporterBegin

func (filesystem *Filesystem) ImporterBegin(location string) error

func (*Filesystem) ImporterEnd

func (filesystem *Filesystem) ImporterEnd() error

func (*Filesystem) ImporterOpen

func (filesystem *Filesystem) ImporterOpen(filename string) (io.ReadCloser, error)

func (*Filesystem) ListDirectories

func (filesystem *Filesystem) ListDirectories() []string

func (*Filesystem) ListFiles

func (filesystem *Filesystem) ListFiles() []string

func (*Filesystem) ListNonRegular

func (filesystem *Filesystem) ListNonRegular() []string

func (*Filesystem) ListStat

func (filesystem *Filesystem) ListStat() []string

func (*Filesystem) Lookup

func (filesystem *Filesystem) Lookup(pathname string) (*FilesystemNode, error)

func (*Filesystem) LookupChildren

func (filesystem *Filesystem) LookupChildren(pathname string) ([]string, error)

func (*Filesystem) LookupInode

func (filesystem *Filesystem) LookupInode(pathname string) (*FileInfo, bool)

func (*Filesystem) LookupInodeForDirectory

func (filesystem *Filesystem) LookupInodeForDirectory(pathname string) (*FileInfo, bool)

func (*Filesystem) LookupInodeForFile

func (filesystem *Filesystem) LookupInodeForFile(pathname string) (*FileInfo, bool)

func (*Filesystem) NDirectories

func (filesystem *Filesystem) NDirectories() uint64

func (*Filesystem) NFiles

func (filesystem *Filesystem) NFiles() uint64

func (*Filesystem) Scan

func (filesystem *Filesystem) Scan(c chan<- int64, directory string, skip []string) error

func (*Filesystem) Serialize

func (filesystem *Filesystem) Serialize() ([]byte, error)

func (*Filesystem) Size

func (filesystem *Filesystem) Size() uint64

type FilesystemNode

type FilesystemNode struct {
	Inode    string
	Children map[string]*FilesystemNode
	// contains filtered or unexported fields
}

Directories

Path Synopsis
fs
s3

Jump to

Keyboard shortcuts

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