Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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

func (*MemoryFileSystem) Stat

func (mfs *MemoryFileSystem) Stat(path string) (os.FileInfo, error)

Stat returns file information

func (*MemoryFileSystem) WriteFile

func (mfs *MemoryFileSystem) WriteFile(path string, data []byte) error

WriteFile writes data to a file (convenience method)

Jump to

Keyboard shortcuts

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