Documentation
¶
Overview ¶
Package rwfs provides a Read Write File System to extend the standard io/fs package with the ability to write to the file system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrHooksNotSupported = errors.New("hooks not supported")
Functions ¶
This section is empty.
Types ¶
type MemoryWFS ¶
MemoryWFS is a WFS implementation that uses a memory file system from github.com/psanford/memfs This should only be used for testing purposes, but may have other uses in the future.
func NewMemoryWFS ¶
func NewMemoryWFS() *MemoryWFS
type OsWFS ¶
func NewOsWFS ¶
NewOsWFS returns a new OsWFS with the given root path The root path is used to join the path to the file system for all receiver operations
func (*OsWFS) MkdirAll ¶
MkdirAll wraps os.MkdirAll implementing and Joins the root path to the path before calling os.MkdirAll
type ReadFS ¶
ReadFS is a read only file system that can be used to read files from a file system. It is a alias for fs.FS.
type WriteFS ¶
type WriteFS interface { fs.FS MkdirAll(path string, perm fs.FileMode) error WriteFile(name string, data []byte, perm fs.FileMode) error RunHook(name string, data []byte, args []string) error }
WriteFS is a file system that can be used to read and write files. It is a alias for fs.FS that also implements Mkdir, MkdirAll and Create.