mockfile

package
v0.0.0-...-ce9bd75 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReadDirFailed = errors.New("ReadDir failed")
)

Functions

This section is empty.

Types

type DirEntriesMap

type DirEntriesMap map[string][]fs.DirEntry

type MockFileInfo

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

func NewMockFileInfo

func NewMockFileInfo(name string, isDir bool) *MockFileInfo

func (MockFileInfo) IsDir

func (m MockFileInfo) IsDir() bool

func (MockFileInfo) ModTime

func (m MockFileInfo) ModTime() time.Time

func (MockFileInfo) Mode

func (m MockFileInfo) Mode() fs.FileMode

func (MockFileInfo) Name

func (m MockFileInfo) Name() string

func (MockFileInfo) Size

func (m MockFileInfo) Size() int64

func (MockFileInfo) Sys

func (m MockFileInfo) Sys() any

type MockFileSystem

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

func NewMockFileSystem

func NewMockFileSystem(fsMap DirEntriesMap, getwdErr error, fails []string) *MockFileSystem

func (*MockFileSystem) FileExist

func (m *MockFileSystem) FileExist(name string) bool

func (*MockFileSystem) Getwd

func (m *MockFileSystem) Getwd() (string, error)

func (*MockFileSystem) ReadDir

func (m *MockFileSystem) ReadDir(name string) ([]fs.DirEntry, error)

Jump to

Keyboard shortcuts

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