vfs

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx *cli.Context)

Init initialize the gopathfs package.

Types

type Entry

type Entry interface {
	// Virtual returns the virtual file of this entry.
	Virtual() string
	// Actual returns the actual file mapped by this virtual file.
	Actual() string
	// Attr returns the attrs of this entry.
	Attr() (*fuse.Attr, error)
	// Readonly returns true if this virtual file is readonly.
	Readonly() bool
	// Parent returns the parent entry.
	Parent() Entry
	// GetChild returns the child entry.
	GetChild(key string) Entry
	// SetChild sets the child entry with key.
	SetChild(key string, entry Entry)
	// DeleteChild deletes child entry by key.
	DeleteChild(key string)
	Children() []fuse.DirEntry
	// Print prints the entry.
	Print(w io.Writer, prefix string)
}

Entry is an interface for the virtual directory or file.

type FileSystem

type FileSystem interface {
	// MatchPath finds the actual file for the given virtual file, returning
	// the deepest Entry object matched in the virtual file system and the
	// remaining unmatched paths.
	MatchPath(virtual string) (Entry, []string)

	// Track tracks the mapping from virtual file to the actual file.
	Track(virtual, actual string, readonly bool)

	// Untrack removes the mapping from the given virtual file.
	Untrack(virtual string) error

	String() string
}

FileSystem is an interface to abstract file systems.

func New

func New(actual string) (FileSystem, error)

New creates and returns a new FileSystem tracking the actual file.

Jump to

Keyboard shortcuts

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