Documentation ¶
Index ¶
- type DirMapping
- type FSAccessor
- type FastCache
- type FileTree
- func (f *FileTree) Mkdir(plainPath string) error
- func (f *FileTree) ReadDir(plainPath string) ([]os.FileInfo, error)
- func (f *FileTree) ReadFile(plainPath string) ([]byte, error)
- func (f *FileTree) Remove(plainPath string) error
- func (f *FileTree) Rename(plainPath string, target string) error
- func (f *FileTree) Stat(plainPath string) (os.FileInfo, error)
- func (f *FileTree) WriteFile(plainPath string, data []byte) (int64, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirMapping ¶
type FSAccessor ¶
type FSAccessor interface { ReadFile(path string) ([]byte, error) Stat(path string) (os.FileInfo, error) ReadDir(path string) ([]os.FileInfo, error) }
FSAccessor defines an accessor to the real underlying filesystem
type FastCache ¶
type FastCache struct {
// contains filtered or unexported fields
}
func NewFastCache ¶
func (*FastCache) Clear ¶
func (f *FastCache) Clear()
Clear removes all entries from the fast cache and the tree cache.
func (*FastCache) Find ¶
func (f *FastCache) Find(pPath string) (DirMapping, bool)
Find tries to find the given plaintext directory in the cache, returning false if it is not found. Because FastCache is an LRU cache, successfully resolving the entry will make it the most recently used entry in the cache.
func (*FastCache) Store ¶
Store stores the given directory mapping in the fast cache. The cache behaves like an LRU cache with a capacity of 16 entries. When storing an entry would cause the cache to exceed its capacity, it will evict the least recently used item in the cache.
This could technically be used for files, but it's probably more efficient to use for directories.