Documentation
¶
Index ¶
- func NewDirEntry(name string) fs.DirEntry
- type DirEntry
- type MemoryFS
- func (mfs *MemoryFS) Chdir(dir string) error
- func (mfs *MemoryFS) Create(name string) (filesystem.WritableFile, error)
- func (mfs *MemoryFS) FileExists(file string) bool
- func (mfs *MemoryFS) Mkdir(name string, perm fs.FileMode) error
- func (mfs *MemoryFS) MkdirAll(path string, perm fs.FileMode) error
- func (mfs *MemoryFS) Open(name string) (fs.File, error)
- func (mfs *MemoryFS) OpenFile(name string, flag int, perm os.FileMode) (filesystem.WritableFile, error)
- func (mfs *MemoryFS) ReadDir(dir string) ([]fs.DirEntry, error)
- func (mfs *MemoryFS) ReadFile(name string) ([]byte, error)
- func (mfs *MemoryFS) Stat(name string) (fs.FileInfo, error)
- func (mfs *MemoryFS) WriteFile(name string, data []byte, perm fs.FileMode) error
- type MemoryFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDirEntry ¶
Types ¶
type MemoryFS ¶
type MemoryFS struct {
// contains filtered or unexported fields
}
MemoryFS is an in-memory file system used to read and write files. This implements fs.FS, fs.ReadFileFS, OpenFileFS, WriteFileFS.
func NewMemoryFS ¶
func NewMemoryFS() *MemoryFS
func (*MemoryFS) Create ¶ added in v6.2.1
func (mfs *MemoryFS) Create(name string) (filesystem.WritableFile, error)
func (*MemoryFS) FileExists ¶
func (*MemoryFS) OpenFile ¶
func (mfs *MemoryFS) OpenFile(name string, flag int, perm os.FileMode) (filesystem.WritableFile, error)
type MemoryFile ¶
type MemoryFile struct {
// contains filtered or unexported fields
}
MemoryFile is an in-memory file struct that implements fs.File, WritableFile
func (*MemoryFile) Close ¶
func (mf *MemoryFile) Close() error
func (*MemoryFile) Name ¶
func (mf *MemoryFile) Name() string
func (*MemoryFile) WriteString ¶
func (mf *MemoryFile) WriteString(s string) (int, error)
Click to show internal directories.
Click to hide internal directories.