Documentation ¶
Index ¶
- type FakeFileSystem
- func (f *FakeFileSystem) Chmod(file string, mode os.FileMode) error
- func (f *FakeFileSystem) Copy(sourcePath, targetPath string, filesToIgnore map[string]string) error
- func (f *FakeFileSystem) CopyContents(sourcePath, targetPath string, filesToIgnore map[string]string) error
- func (f *FakeFileSystem) Create(file string) (io.WriteCloser, error)
- func (f *FakeFileSystem) CreateWorkingDirectory() (string, error)
- func (f *FakeFileSystem) Exists(file string) bool
- func (f *FakeFileSystem) KeepSymlinks(k bool)
- func (f *FakeFileSystem) Lstat(p string) (os.FileInfo, error)
- func (f *FakeFileSystem) Mkdir(dirname string) error
- func (f *FakeFileSystem) MkdirAll(dirname string) error
- func (f *FakeFileSystem) MkdirAllWithPermissions(dirname string, perm os.FileMode) error
- func (f *FakeFileSystem) Open(file string) (io.ReadCloser, error)
- func (f *FakeFileSystem) ReadDir(p string) ([]os.FileInfo, error)
- func (f *FakeFileSystem) Readlink(name string) (string, error)
- func (f *FakeFileSystem) RemoveDirectory(dir string) error
- func (f *FakeFileSystem) Rename(from, to string) error
- func (f *FakeFileSystem) ShouldKeepSymlinks() bool
- func (f *FakeFileSystem) Stat(p string) (os.FileInfo, error)
- func (f *FakeFileSystem) Symlink(oldname, newname string) error
- func (f *FakeFileSystem) Walk(root string, walkFn filepath.WalkFunc) error
- func (f *FakeFileSystem) WriteFile(file string, data []byte) error
- type FakeReadCloser
- type FakeWriteCloser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeFileSystem ¶
type FakeFileSystem struct { ChmodFile []string ChmodMode os.FileMode ChmodError map[string]error RenameFrom string RenameTo string RenameError error MkdirAllDir []string MkdirAllError error MkdirDir string MkdirError error ExistsFile []string ExistsResult map[string]bool CopySource string CopyDest string CopyError error FilesToIgnore map[string]string RemoveDirName string RemoveDirError error WorkingDirCalled bool WorkingDirResult string WorkingDirError error OpenFile string OpenFileResult *FakeReadCloser OpenContent string OpenError error OpenCloseError error CreateFile string CreateContent FakeWriteCloser CreateError error WriteFileName string WriteFileError error WriteFileContent string ReadlinkName string ReadlinkError error SymlinkOldname string SymlinkNewname string SymlinkError error Files []os.FileInfo // contains filtered or unexported fields }
FakeFileSystem provides a fake filesystem structure for testing
func (*FakeFileSystem) Chmod ¶
func (f *FakeFileSystem) Chmod(file string, mode os.FileMode) error
Chmod manipulates permissions on the fake filesystem
func (*FakeFileSystem) Copy ¶
func (f *FakeFileSystem) Copy(sourcePath, targetPath string, filesToIgnore map[string]string) error
Copy copies files on the fake filesystem
func (*FakeFileSystem) CopyContents ¶
func (f *FakeFileSystem) CopyContents(sourcePath, targetPath string, filesToIgnore map[string]string) error
CopyContents copies directory contents on the fake filesystem
func (*FakeFileSystem) Create ¶
func (f *FakeFileSystem) Create(file string) (io.WriteCloser, error)
Create creates a file
func (*FakeFileSystem) CreateWorkingDirectory ¶
func (f *FakeFileSystem) CreateWorkingDirectory() (string, error)
CreateWorkingDirectory creates a fake working directory
func (*FakeFileSystem) Exists ¶
func (f *FakeFileSystem) Exists(file string) bool
Exists checks if the file exists in fake filesystem
func (*FakeFileSystem) KeepSymlinks ¶
func (f *FakeFileSystem) KeepSymlinks(k bool)
KeepSymlinks controls whether to handle symlinks as symlinks or follow symlinks and copy files with content
func (*FakeFileSystem) Lstat ¶
func (f *FakeFileSystem) Lstat(p string) (os.FileInfo, error)
Lstat provides stats about a single file (not following symlinks)
func (*FakeFileSystem) Mkdir ¶
func (f *FakeFileSystem) Mkdir(dirname string) error
Mkdir creates a new directory on the fake filesystem
func (*FakeFileSystem) MkdirAll ¶
func (f *FakeFileSystem) MkdirAll(dirname string) error
MkdirAll creates a new directories on the fake filesystem
func (*FakeFileSystem) MkdirAllWithPermissions ¶
func (f *FakeFileSystem) MkdirAllWithPermissions(dirname string, perm os.FileMode) error
MkdirAllWithPermissions creates a new directories on the fake filesystem
func (*FakeFileSystem) Open ¶
func (f *FakeFileSystem) Open(file string) (io.ReadCloser, error)
Open opens a file
func (*FakeFileSystem) ReadDir ¶
func (f *FakeFileSystem) ReadDir(p string) ([]os.FileInfo, error)
ReadDir reads the files in specified directory
func (*FakeFileSystem) Readlink ¶
func (f *FakeFileSystem) Readlink(name string) (string, error)
Readlink reads the destination of a symlink
func (*FakeFileSystem) RemoveDirectory ¶
func (f *FakeFileSystem) RemoveDirectory(dir string) error
RemoveDirectory removes a directory in the fake filesystem
func (*FakeFileSystem) Rename ¶
func (f *FakeFileSystem) Rename(from, to string) error
Rename renames files on the fake filesystem
func (*FakeFileSystem) ShouldKeepSymlinks ¶
func (f *FakeFileSystem) ShouldKeepSymlinks() bool
ShouldKeepSymlinks informs whether to handle symlinks as symlinks or follow symlinks and copy files by content
func (*FakeFileSystem) Stat ¶
func (f *FakeFileSystem) Stat(p string) (os.FileInfo, error)
Stat returns a FileInfo describing the named file
func (*FakeFileSystem) Symlink ¶
func (f *FakeFileSystem) Symlink(oldname, newname string) error
Symlink creates a symlink at newname, pointing to oldname
type FakeReadCloser ¶
FakeReadCloser provider a fake ReadCloser
func (*FakeReadCloser) Close ¶
func (f *FakeReadCloser) Close() error
Close closes the fake ReadCloser
type FakeWriteCloser ¶
FakeWriteCloser provider a fake ReadCloser
func (*FakeWriteCloser) Close ¶
func (f *FakeWriteCloser) Close() error
Close closes the fake ReadCloser