Documentation
¶
Overview ¶
Package filesystem provides an FS abstraction over operating system files overlaid with unsaved editor content.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DocumentStore ¶
type DocumentStore interface {
Get(document.Handle) (*document.Document, error)
List(document.DirHandle) []*document.Document
}
DocumentStore proves list and get facilities for unsaved documents.
type Filesystem ¶
type Filesystem struct {
// contains filtered or unexported fields
}
Filesystem provides io/fs.FS compatible two-layer read-only filesystem with preferred source being DocumentStore and native OS FS acting as fallback.
This allows for reading files in a directory while reflecting unsaved changes.
func New ¶
func New(docStore DocumentStore) *Filesystem
New creates an OS filesystem overlaid with the supplied document store.
func (*Filesystem) Open ¶
func (f *Filesystem) Open(name string) (fs.File, error)
Open implements fs.FS.
func (*Filesystem) ReadDir ¶
func (f *Filesystem) ReadDir(dir string) ([]fs.DirEntry, error)
ReadDir provides entries under the supplied directory path.
Click to show internal directories.
Click to hide internal directories.