memfs

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrossDeviceTestFs

type CrossDeviceTestFs struct {
	afero.Fs
}

A filesystem wrapper whose implementation of Rename will return EXDEV if the source and destination paths do not share the same first path component. This is to simulate cross-device rename errors.

func (*CrossDeviceTestFs) Rename

func (c *CrossDeviceTestFs) Rename(oldpath, newpath string) error

type ModeAwareMemMapFs

type ModeAwareMemMapFs struct {
	Fs afero.Fs
}

func NewModeAwareMemFs

func NewModeAwareMemFs() *ModeAwareMemMapFs

func (*ModeAwareMemMapFs) Chmod

func (m *ModeAwareMemMapFs) Chmod(name string, mode os.FileMode) error

func (*ModeAwareMemMapFs) Chown

func (m *ModeAwareMemMapFs) Chown(name string, uid, gid int) error

func (*ModeAwareMemMapFs) Chtimes

func (m *ModeAwareMemMapFs) Chtimes(name string, atime time.Time, mtime time.Time) error

func (*ModeAwareMemMapFs) Create

func (m *ModeAwareMemMapFs) Create(name string) (afero.File, error)

Create creates a file in the filesystem, returning the file and an error, if any happens.

func (*ModeAwareMemMapFs) Mkdir

func (m *ModeAwareMemMapFs) Mkdir(name string, perm os.FileMode) error

Mkdir creates a directory in the filesystem, return an error if any happens.

func (*ModeAwareMemMapFs) MkdirAll

func (m *ModeAwareMemMapFs) MkdirAll(path string, perm os.FileMode) error

MkdirAll creates a directory path and all parents that does not exist yet.

func (*ModeAwareMemMapFs) Name

func (m *ModeAwareMemMapFs) Name() string

func (*ModeAwareMemMapFs) Open

func (m *ModeAwareMemMapFs) Open(name string) (afero.File, error)

Open opens a file, returning it or an error, if any happens.

func (*ModeAwareMemMapFs) OpenFile

func (m *ModeAwareMemMapFs) OpenFile(name string, flag int, perm os.FileMode) (afero.File, error)

OpenFile opens a file using the given flags and the given mode.

func (*ModeAwareMemMapFs) Remove

func (m *ModeAwareMemMapFs) Remove(name string) error

Remove removes a file identified by name, returning an error, if any happens.

func (*ModeAwareMemMapFs) RemoveAll

func (m *ModeAwareMemMapFs) RemoveAll(path string) error

RemoveAll removes a directory path and any children it contains. It does not fail if the path does not exist (return nil).

func (*ModeAwareMemMapFs) Rename

func (m *ModeAwareMemMapFs) Rename(oldname string, newname string) error

Rename renames a file.

func (*ModeAwareMemMapFs) Stat

func (m *ModeAwareMemMapFs) Stat(name string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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