mem

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExist         = os.ErrExist
	ErrNotExist      = os.ErrNotExist
	ErrBadDescriptor = errors.New("bad descriptor")
	ErrIsDirectory   = errors.New("is a directory")
	ErrNotDirectory  = errors.New("is not a directory")
)

Functions

This section is empty.

Types

type FS

type FS struct {
	// contains filtered or unexported fields
}

func NewFS

func NewFS() (*FS, error)

NewFS creates a new virtual filesystem

func (*FS) Create

func (fs *FS) Create(name string) (risoros.File, error)

Create creates a new file

func (*FS) Mkdir

func (fs *FS) Mkdir(name string, perm risoros.FileMode) error

Mkdir creates a new directory

func (*FS) MkdirAll

func (fs *FS) MkdirAll(pth string, perm risoros.FileMode) error

MkdirAll creates a directory and all necessary parents

func (*FS) Open

func (fs *FS) Open(name string) (risoros.File, error)

Open opens a file for reading

func (*FS) OpenFile

func (fs *FS) OpenFile(name string, flag int, perm risoros.FileMode) (risoros.File, error)

OpenFile opens a file with specified flags

func (*FS) ReadDir

func (fs *FS) ReadDir(name string) ([]risoros.DirEntry, error)

ReadDir reads directory contents

func (*FS) ReadFile

func (fs *FS) ReadFile(name string) ([]byte, error)

ReadFile reads the entire contents of a file

func (*FS) Remove

func (fs *FS) Remove(name string) error

Remove removes a file or empty directory

func (*FS) RemoveAll

func (fs *FS) RemoveAll(pth string) error

RemoveAll removes a path and all its children

func (*FS) Rename

func (fs *FS) Rename(oldpath, newpath string) error

Rename renames a file or directory

func (*FS) Stat

func (fs *FS) Stat(name string) (risoros.FileInfo, error)

Stat returns file information

func (fs *FS) Symlink(oldname, newname string) error

Symlink creates a symbolic link

func (*FS) WalkDir

func (fs *FS) WalkDir(root string, fn risoros.WalkDirFunc) error

WalkDir walks the directory tree

func (*FS) WriteFile

func (fs *FS) WriteFile(name string, data []byte, perm risoros.FileMode) error

WriteFile writes data to a file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL