vfs

package
v0.0.0-...-52b1b20 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ViewNamePrefix = "view@"
)

Variables

This section is empty.

Functions

func IsViewPath

func IsViewPath(fn string) bool

Types

type Blob

type Blob struct {
	Limit int
	// contains filtered or unexported fields
}

func Blobs

func Blobs(nd *Node) (blobs []*Blob)

func (*Blob) Error

func (b *Blob) Error() error

func (*Blob) Len

func (b *Blob) Len() int

func (*Blob) OpenFile

func (b *Blob) OpenFile() (io.ReadCloser, error)

func (*Blob) ReadCloser

func (b *Blob) ReadCloser() io.ReadCloser

func (*Blob) ReadFile

func (b *Blob) ReadFile() ([]byte, error)

func (*Blob) Reader

func (b *Blob) Reader() io.Reader

type Dirent

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

func (Dirent) IsDir

func (fm Dirent) IsDir() bool

func (Dirent) IsRegular

func (fm Dirent) IsRegular() bool
func (fm Dirent) IsSymlink() bool

func (Dirent) IsValid

func (fm Dirent) IsValid() bool

func (Dirent) Mode

func (fm Dirent) Mode() os.FileMode

func (*Dirent) Name

func (de *Dirent) Name() string

type FS

type FS struct{ Node }

func New

func New() *FS

func (*FS) Closest

func (fs *FS) Closest(path string, f func(nd *Node) bool) *Node

func (*FS) Invalidate

func (fs *FS) Invalidate(path string)

func (*FS) IsDir

func (fs *FS) IsDir(path string) bool

func (*FS) IsFile

func (fs *FS) IsFile(path string) bool

func (*FS) Memo

func (fs *FS) Memo(path string) (*Node, *memo.M, error)

func (*FS) PeekBlob

func (fs *FS) PeekBlob(path string) *Blob

func (*FS) PeekMemo

func (fs *FS) PeekMemo(path string, k memo.K) memo.V

func (*FS) ReadBlob

func (fs *FS) ReadBlob(path string) *Blob

func (*FS) ReadDir

func (fs *FS) ReadDir(path string) ([]os.FileInfo, error)

func (*FS) ReadMemo

func (fs *FS) ReadMemo(path string, k memo.K, new func() memo.K) memo.V

func (*FS) Scan

func (fs *FS) Scan(path string, so ScanOptions)

func (*FS) Stat

func (fs *FS) Stat(path string) (*Node, os.FileInfo, error)

type FileInfo

type FileInfo struct {
	Node *Node
	// contains filtered or unexported fields
}

func (*FileInfo) IsDir

func (fi *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (fi *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (fi *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (fi *FileInfo) Name() string

func (*FileInfo) Size

func (fi *FileInfo) Size() int64

func (*FileInfo) Sys

func (fi *FileInfo) Sys() interface{}

type Node

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

func (*Node) Branches

func (nd *Node) Branches(f func(nd *Node))

func (*Node) Children

func (nd *Node) Children() *NodeList

func (*Node) Closest

func (nd *Node) Closest(f func(nd *Node) bool) *Node

func (*Node) Invalidate

func (nd *Node) Invalidate()

func (*Node) IsBranch

func (nd *Node) IsBranch() bool

func (*Node) IsDescendant

func (nd *Node) IsDescendant(ancestor *Node) bool

func (*Node) IsDir

func (nd *Node) IsDir() bool

func (*Node) IsFile

func (nd *Node) IsFile() bool

func (*Node) IsLeaf

func (nd *Node) IsLeaf() bool

func (*Node) IsRoot

func (nd *Node) IsRoot() bool

func (*Node) Locate

func (nd *Node) Locate(name string) (*Node, os.FileInfo, error)

func (*Node) Ls

func (nd *Node) Ls() *NodeList

func (*Node) Memo

func (nd *Node) Memo() (*memo.M, error)

func (*Node) Name

func (nd *Node) Name() string

func (*Node) Parent

func (nd *Node) Parent() *Node

func (*Node) Path

func (nd *Node) Path() string

func (*Node) Peek

func (nd *Node) Peek(path string) *Node

func (*Node) PeekBlob

func (nd *Node) PeekBlob() *Blob

func (*Node) PeekMemo

func (nd *Node) PeekMemo(k memo.K) memo.V

func (*Node) Poke

func (nd *Node) Poke(path string) *Node

func (*Node) Print

func (nd *Node) Print(w io.Writer)

func (*Node) PrintWithFilter

func (nd *Node) PrintWithFilter(w io.Writer, filter func(*Node) string)

func (*Node) ReadBlob

func (nd *Node) ReadBlob() *Blob

func (*Node) ReadDir

func (nd *Node) ReadDir() ([]os.FileInfo, error)

func (*Node) ReadMemo

func (nd *Node) ReadMemo(k memo.K, new func() memo.V) memo.V

func (*Node) Stat

func (nd *Node) Stat() (os.FileInfo, error)

func (*Node) String

func (nd *Node) String() string

type NodeList

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

func (*NodeList) Add

func (n *NodeList) Add(nd *Node) *NodeList

func (*NodeList) Copy

func (n *NodeList) Copy() *NodeList

func (*NodeList) Filter

func (n *NodeList) Filter(f func(nd *Node) bool) *NodeList

func (*NodeList) Find

func (n *NodeList) Find(name string) (index int, c *Node)

func (*NodeList) Index

func (n *NodeList) Index(nd *Node) (index int)

func (*NodeList) Len

func (n *NodeList) Len() int

func (*NodeList) Node

func (n *NodeList) Node(name string) *Node

func (*NodeList) Nodes

func (n *NodeList) Nodes() []*Node

func (*NodeList) Some

func (n *NodeList) Some(f func(nd *Node) bool) bool

func (*NodeList) Sorted

func (n *NodeList) Sorted() *NodeList

type ScanOptions

type ScanOptions struct {
	Filter   func(de *Dirent) bool
	Dirs     func(nd *Node)
	MaxDepth int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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