Documentation ¶
Index ¶
- type FS
- func (m *FS) CopyFilesUnder(dir string) error
- func (m *FS) Filter(skippedFiles []string) (*FS, error)
- func (m *FS) FilterFunc(fn func(path string, d fs.DirEntry) (bool, error)) (*FS, error)
- func (m *FS) Glob(pattern string) ([]string, error)
- func (m *FS) MkdirAll(path string, perm fs.FileMode) error
- func (m *FS) Open(name string) (fs.File, error)
- func (m *FS) ReadDir(name string) ([]fs.DirEntry, error)
- func (m *FS) ReadFile(name string) ([]byte, error)
- func (m *FS) Remove(path string) error
- func (m *FS) RemoveAll(path string) error
- func (m *FS) Stat(name string) (fs.FileInfo, error)
- func (m *FS) Sub(dir string) (fs.FS, error)
- func (m *FS) WriteFile(path, underlyingPath string) error
- func (m *FS) WriteVirtualFile(path string, data []byte, mode fs.FileMode) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS is an in-memory filesystem
func (*FS) CopyFilesUnder ¶
func (*FS) FilterFunc ¶
func (*FS) Glob ¶
Glob returns the names of all files matching pattern or nil if there is no matching file. The syntax of patterns is the same as in Match. The pattern may describe hierarchical names such as /usr/*/bin/ed (assuming the Separator is '/').
Glob ignores file system errors such as I/O errors reading directories. The only possible returned error is ErrBadPattern, when pattern is malformed.
func (*FS) MkdirAll ¶
MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm (before umask) are used for all directories that MkdirAll creates. If path is already a directory, MkdirAll does nothing and returns nil.
func (*FS) ReadDir ¶
ReadDir reads the named directory and returns a list of directory entries sorted by filename.
func (*FS) ReadFile ¶
ReadFile reads the named file and returns its contents. A successful call returns a nil error, not io.EOF. (Because ReadFile reads the whole file, the expected EOF from the final Read is not treated as an error to be reported.)
The caller is permitted to modify the returned byte slice. This method should return a copy of the underlying data.
func (*FS) RemoveAll ¶
RemoveAll deletes a file or directory and any children if present from the filesystem