mockfs

package
v0.0.0-...-244c41e Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockFs

type MockFs struct {
	CreateFunc    func(name string) (gofs.File, error)
	RemoveFunc    func(path string) error
	RemoveAllFunc func(path string) error
	StatFunc      func(path string) (os.FileInfo, error)
	LstatFunc     func(path string) (os.FileInfo, error)
	ReadFileFunc  func(path string) ([]byte, error)
	ReadDirFunc   func(dirname string) ([]os.FileInfo, error)
	MkdirFunc     func(path string, perm os.FileMode) error
	MkdirAllFunc  func(path string, perm os.FileMode) error
	OpenFunc      func(path string) (gofs.File, error)
	WriteFileFunc func(path string, data []byte, perm os.FileMode) error
	RenameFunc    func(old, new string) error
	OpenFileFunc  func(name string, flag int, perm os.FileMode) (gofs.File, error)
	ChmodFunc     func(name string, mode os.FileMode) error
	SymlinkFunc   func(oldname, newname string) error
	ReadlinkFunc  func(path string) (string, error)
}

func NewMockFs

func NewMockFs() MockFs

func (MockFs) Chmod

func (fs MockFs) Chmod(name string, mode os.FileMode) error

func (MockFs) Create

func (fs MockFs) Create(name string) (gofs.File, error)

func (MockFs) Lstat

func (fs MockFs) Lstat(path string) (os.FileInfo, error)

func (MockFs) Mkdir

func (fs MockFs) Mkdir(path string, perm os.FileMode) error

func (MockFs) MkdirAll

func (fs MockFs) MkdirAll(path string, perm os.FileMode) error

func (MockFs) Open

func (fs MockFs) Open(name string) (gofs.File, error)

func (MockFs) OpenFile

func (fs MockFs) OpenFile(name string, flag int, perm os.FileMode) (gofs.File, error)

func (MockFs) ReadDir

func (fs MockFs) ReadDir(path string) ([]os.FileInfo, error)

func (MockFs) ReadFile

func (fs MockFs) ReadFile(path string) ([]byte, error)
func (fs MockFs) Readlink(path string) (string, error)

func (MockFs) Remove

func (fs MockFs) Remove(path string) error

func (MockFs) RemoveAll

func (fs MockFs) RemoveAll(path string) error

func (MockFs) Rename

func (fs MockFs) Rename(old, new string) error

func (MockFs) Stat

func (fs MockFs) Stat(path string) (os.FileInfo, error)
func (fs MockFs) Symlink(oldName, newName string) error

func (MockFs) WriteFile

func (fs MockFs) WriteFile(path string, data []byte, perm os.FileMode) error

Jump to

Keyboard shortcuts

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