memoryfs

package
v6.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDirEntry

func NewDirEntry(name string) fs.DirEntry

Types

type DirEntry

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

func (*DirEntry) Info

func (d *DirEntry) Info() (fs.FileInfo, error)

func (*DirEntry) IsDir

func (d *DirEntry) IsDir() bool

func (*DirEntry) Name

func (d *DirEntry) Name() string

func (*DirEntry) Type

func (d *DirEntry) Type() fs.FileMode

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) Chdir added in v6.2.1

func (mfs *MemoryFS) Chdir(dir string) error

func (*MemoryFS) Create added in v6.2.1

func (mfs *MemoryFS) Create(name string) (filesystem.WritableFile, error)

func (*MemoryFS) FileExists

func (mfs *MemoryFS) FileExists(file string) bool

func (*MemoryFS) Mkdir

func (mfs *MemoryFS) Mkdir(name string, perm fs.FileMode) error

func (*MemoryFS) MkdirAll added in v6.2.1

func (mfs *MemoryFS) MkdirAll(path string, perm fs.FileMode) error

func (*MemoryFS) Open

func (mfs *MemoryFS) Open(name string) (fs.File, error)

func (*MemoryFS) OpenFile

func (mfs *MemoryFS) OpenFile(name string, flag int, perm os.FileMode) (filesystem.WritableFile, error)

func (*MemoryFS) ReadDir

func (mfs *MemoryFS) ReadDir(dir string) ([]fs.DirEntry, error)

func (*MemoryFS) ReadFile

func (mfs *MemoryFS) ReadFile(name string) ([]byte, error)

func (*MemoryFS) Stat

func (mfs *MemoryFS) Stat(name string) (fs.FileInfo, error)

func (*MemoryFS) WriteFile

func (mfs *MemoryFS) WriteFile(name string, data []byte, perm fs.FileMode) 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) Read

func (mf *MemoryFile) Read(b []byte) (int, error)

func (*MemoryFile) Stat

func (mf *MemoryFile) Stat() (fs.FileInfo, error)

func (*MemoryFile) Write

func (mf *MemoryFile) Write(b []byte) (int, error)

func (*MemoryFile) WriteString

func (mf *MemoryFile) WriteString(s string) (int, error)

Jump to

Keyboard shortcuts

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