filesystem

package
v1.16.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type TestFs

type TestFs struct {
	BaseFs        afero.Fs
	MockCreate    func(name string) (afero.File, error)
	MockMkdir     func(name string, perm os.FileMode) error
	MockMkdirAll  func(path string, perm os.FileMode) error
	MockOpen      func(name string) (afero.File, error)
	MockOpenFile  func(name string, flag int, perm os.FileMode) (afero.File, error)
	MockRemove    func(name string) error
	MockRemoveAll func(path string) error
	MockRename    func(oldname, newname string) error
	MockStat      func(name string) (os.FileInfo, error)
	MockChmod     func(name string, mode os.FileMode) error
	MockChtimes   func(name string, atime time.Time, mtime time.Time) error
}

func NewTestFs

func NewTestFs(baseFs afero.Fs) *TestFs

func (*TestFs) Chmod

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

func (*TestFs) Chtimes

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

func (*TestFs) Create

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

func (*TestFs) Mkdir

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

func (*TestFs) MkdirAll

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

func (*TestFs) Name

func (*TestFs) Name() string

func (*TestFs) Open

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

func (*TestFs) OpenFile

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

func (*TestFs) Remove

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

func (*TestFs) RemoveAll

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

func (*TestFs) Rename

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

func (*TestFs) Stat

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

Jump to

Keyboard shortcuts

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