Documentation
¶
Index ¶
- type MemoryFileSystem
- func (mfs *MemoryFileSystem) Clear()
- func (mfs *MemoryFileSystem) Create(path string) (io.File, error)
- func (mfs *MemoryFileSystem) Exists(path string) (bool, error)
- func (mfs *MemoryFileSystem) ListDir(path string) ([]os.FileInfo, error)
- func (mfs *MemoryFileSystem) MkdirAll(path string, perm os.FileMode) error
- func (mfs *MemoryFileSystem) Open(path string) (io.File, error)
- func (mfs *MemoryFileSystem) ReadFile(path string) ([]byte, error)
- func (mfs *MemoryFileSystem) Remove(path string) error
- func (mfs *MemoryFileSystem) Stat(path string) (os.FileInfo, error)
- func (mfs *MemoryFileSystem) WriteFile(path string, data []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryFileSystem ¶
type MemoryFileSystem struct {
// contains filtered or unexported fields
}
MemoryFileSystem implements an in-memory file system for testing and CI
func NewMemoryFileSystem ¶
func NewMemoryFileSystem() *MemoryFileSystem
NewMemoryFileSystem creates a new in-memory file system
func (*MemoryFileSystem) Clear ¶
func (mfs *MemoryFileSystem) Clear()
Clear removes all files and directories
func (*MemoryFileSystem) Create ¶
func (mfs *MemoryFileSystem) Create(path string) (io.File, error)
Create creates a new file for writing
func (*MemoryFileSystem) Exists ¶
func (mfs *MemoryFileSystem) Exists(path string) (bool, error)
Exists checks if a file or directory exists
func (*MemoryFileSystem) ListDir ¶
func (mfs *MemoryFileSystem) ListDir(path string) ([]os.FileInfo, error)
ListDir lists directory contents
func (*MemoryFileSystem) MkdirAll ¶
func (mfs *MemoryFileSystem) MkdirAll(path string, perm os.FileMode) error
MkdirAll creates directories recursively
func (*MemoryFileSystem) Open ¶
func (mfs *MemoryFileSystem) Open(path string) (io.File, error)
Open opens a file for reading
func (*MemoryFileSystem) ReadFile ¶
func (mfs *MemoryFileSystem) ReadFile(path string) ([]byte, error)
ReadFile reads data from a file (convenience method)
func (*MemoryFileSystem) Remove ¶
func (mfs *MemoryFileSystem) Remove(path string) error
Remove removes a file
Click to show internal directories.
Click to hide internal directories.