Documentation
¶
Overview ¶
Package fscache provides a caching layer on top of virtual filesystems. The cache itself looks like a regular fs.File, with one difference. It's idemptotent so it can be read many times and it will always return the same result. This is similar to how fstest.MapFS works. This cache greatly reduces the number of repeated file system calls in Bud.
TODO: rework this package. The original plan was to share a single cache across all wrapped filesystems. This can lead to caching issues because the same valid file in two different filesystems will be cached as the same file. For example, "." should return different results for each filesystem. This has been worked around by creating a new cache each time we wrap a filesystem. However, when we start wanting to incrementally updating the cache, we'll only have a single file path, so we'll need to be able to clear multiple caches at that time.
Index ¶
- type Cache
- func (c *Cache) Clear()
- func (c *Cache) Create(name string)
- func (c *Cache) Delete(name string)
- func (c *Cache) Has(path string) (ok bool)
- func (c *Cache) Keys() (keys []string)
- func (c *Cache) Open(path string) (fs.File, error)
- func (c *Cache) Set(path string, entry Entry)
- func (c *Cache) Update(name string)
- func (c *Cache) Wrap(fsname string, fsys fs.FS) fs.FS
- type Dir
- type DirEntry
- type Entry
- type File
- type Wrapped
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.