filesystem

package
v0.33.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DocumentStore added in v0.26.0

type DocumentStore interface {
	GetDocument(document.Handle) (*document.Document, error)
	ListDocumentsInDir(document.DirHandle) ([]*document.Document, error)
}

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 NewFilesystem

func NewFilesystem(docStore DocumentStore) *Filesystem

func (*Filesystem) Open

func (fs *Filesystem) Open(name string) (fs.File, error)

func (*Filesystem) ReadDir added in v0.6.0

func (fs *Filesystem) ReadDir(name string) ([]fs.DirEntry, error)

func (*Filesystem) ReadFile added in v0.6.0

func (fs *Filesystem) ReadFile(name string) ([]byte, error)

func (*Filesystem) SetLogger added in v0.10.0

func (fs *Filesystem) SetLogger(logger *log.Logger)

func (*Filesystem) Stat added in v0.13.0

func (fs *Filesystem) Stat(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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