Documentation ¶
Index ¶
- type Memory
- func (m *Memory) Create(name string) (storage.File, error)
- func (m *Memory) Mkdir(name string, perm fs.FileMode) error
- func (m *Memory) Open(name string) (fs.File, error)
- func (m *Memory) ReadDir(name string) ([]fs.DirEntry, error)
- func (m *Memory) RemoveAll(name string) error
- func (m *Memory) Stat(name string) (fs.FileInfo, error)
- func (m *Memory) WriteFile(name string, data []byte, perm fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func (*Memory) Create ¶
Create creates or truncates the named file. If the file already exists, it is truncated. If the file does not exist, it is created with mode 0666 (before umask). If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR. If there is an error, it will be of type *PathError.
func (*Memory) Mkdir ¶
Mkdir creates a new directory with the specified name and permission bits (before umask). If there is an error, it will be of type *PathError.
func (*Memory) Open ¶
Open opens the named file.
When Open returns an error, it should be of type *PathError with the Op field set to "open", the Path field set to name, and the Err field describing the problem.
Open should reject attempts to open names that do not satisfy ValidPath(name), returning a *PathError with Err set to ErrInvalid or ErrNotExist.
func (*Memory) ReadDir ¶
ReadDir reads the named directory and returns a list of directory entries sorted by filename.
func (*Memory) RemoveAll ¶
RemoveAll removes path and any children it contains. It removes everything it can but returns the first error it encounters. If the path does not exist, RemoveAll returns nil (no error). If there is an error, it will be of type *PathError.
func (*Memory) Stat ¶
Stat returns a FileInfo describing the file. If there is an error, it should be of type *PathError. This makes Memory compatible with the StatFS interface