Documentation
¶
Overview ¶
Package fsx provides filesystem interfaces and test implementations.
Index ¶
- func Exists(fsys FS, path string) bool
- func IsDir(fsys FS, path string) bool
- func IsFile(fsys FS, path string) bool
- type FS
- type Mem
- func (m *Mem) AddDir(p string) *Mem
- func (m *Mem) AddFile(p string, content []byte) *Mem
- func (m *Mem) Paths() []string
- func (m *Mem) ReadDir(p string) ([]fs.DirEntry, error)
- func (m *Mem) ReadFile(p string) ([]byte, error)
- func (m *Mem) RemoveAll(p string) error
- func (m *Mem) Rename(oldPath, newPath string) error
- func (m *Mem) Stat(p string) (fs.FileInfo, error)
- type OS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FS ¶
type FS interface {
Stat(path string) (fs.FileInfo, error)
ReadFile(path string) ([]byte, error)
ReadDir(path string) ([]fs.DirEntry, error)
}
FS is the read-only filesystem surface used by pawn-project.
type Mem ¶
type Mem struct {
// contains filtered or unexported fields
}
Mem is a concurrent, in-memory FS. Paths use forward slashes.
func NewMem ¶
func NewMem() *Mem
NewMem returns an empty in-memory filesystem containing only the root directory "/".
func (*Mem) AddFile ¶
AddFile creates path and any missing parent directories, then sets path's content.
Click to show internal directories.
Click to hide internal directories.