Documentation ¶
Overview ¶
Package filesystem is a mock filesystem.
Index ¶
- type MockFile
- func (m *MockFile) Close() error
- func (m *MockFile) IsDir() bool
- func (m *MockFile) ModTime() time.Time
- func (m *MockFile) Mode() os.FileMode
- func (m *MockFile) Name() string
- func (m *MockFile) Read(dst []byte) (int, error)
- func (m *MockFile) Seek(offset int64, whence int) (int64, error)
- func (m *MockFile) Size() int64
- func (m *MockFile) Sys() interface{}
- type MockFileSystem
- func (m *MockFileSystem) Lstat(path string) (os.FileInfo, error)
- func (m *MockFileSystem) Open(filename string) (vfs.ReadSeekCloser, error)
- func (m *MockFileSystem) ReadDir(path string) ([]os.FileInfo, error)
- func (m *MockFileSystem) RootType(path string) vfs.RootType
- func (m *MockFileSystem) Stat(path string) (os.FileInfo, error)
- func (m *MockFileSystem) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockFile ¶
MockFile is the simple implementation of vfs.ReadSeekCloser.
var NilFile *MockFile
NilFile is a nil mockfile for easy reference.
func NewMockFile ¶
NewMockFile creates a new mock file for use with the mock file system.
type MockFileSystem ¶ added in v3.0.2
MockFileSystem is a mock implementation of the Opener interface, for testing purposes.
func NewMockFileSystem ¶
func NewMockFileSystem(files ...*MockFile) *MockFileSystem
NewMockFileSystem creates a new mock Reader.
func (*MockFileSystem) Lstat ¶ added in v3.0.2
func (m *MockFileSystem) Lstat(path string) (os.FileInfo, error)
Lstat does stat stuff.
func (*MockFileSystem) Open ¶ added in v3.0.2
func (m *MockFileSystem) Open(filename string) (vfs.ReadSeekCloser, error)
Open returns a pre-set data/error pair.
func (*MockFileSystem) ReadDir ¶ added in v3.0.2
func (m *MockFileSystem) ReadDir(path string) ([]os.FileInfo, error)
ReadDir walks the directory.
func (*MockFileSystem) RootType ¶ added in v3.0.2
func (m *MockFileSystem) RootType(path string) vfs.RootType
RootType returns the Root Type.
func (*MockFileSystem) Stat ¶ added in v3.0.2
func (m *MockFileSystem) Stat(path string) (os.FileInfo, error)
Stat gets file stats.
func (*MockFileSystem) String ¶ added in v3.0.2
func (m *MockFileSystem) String() string
Click to show internal directories.
Click to hide internal directories.