Documentation ¶
Index ¶
- type FakeCmdResult
- type FakeCmdRunner
- func (r *FakeCmdRunner) AddCmdResult(fullCmd string, result FakeCmdResult)
- func (r *FakeCmdRunner) AddProcess(fullCmd string, process *FakeProcess)
- func (r *FakeCmdRunner) CommandExists(cmdName string) bool
- func (r *FakeCmdRunner) RunCommand(cmdName string, args ...string) (string, string, int, error)
- func (r *FakeCmdRunner) RunCommandWithInput(input, cmdName string, args ...string) (string, string, int, error)
- func (r *FakeCmdRunner) RunComplexCommand(cmd boshsys.Command) (string, string, int, error)
- func (r *FakeCmdRunner) RunComplexCommandAsync(cmd boshsys.Command) (boshsys.Process, error)
- type FakeFile
- type FakeFileInfo
- type FakeFileStats
- type FakeFileSystem
- func (fs *FakeFileSystem) Chmod(path string, perm os.FileMode) error
- func (fs *FakeFileSystem) Chown(path, username string) error
- func (fs *FakeFileSystem) ConvergeFileContents(path string, content []byte) (bool, error)
- func (fs *FakeFileSystem) CopyDir(srcPath, dstPath string) error
- func (fs *FakeFileSystem) CopyFile(srcPath, dstPath string) error
- func (fs *FakeFileSystem) ExpandPath(path string) (string, error)
- func (fs *FakeFileSystem) FileExists(path string) bool
- func (fs *FakeFileSystem) GetFileTestStat(path string) *FakeFileStats
- func (fs *FakeFileSystem) Glob(pattern string) (matches []string, err error)
- func (fs *FakeFileSystem) HomeDir(username string) (string, error)
- func (fs *FakeFileSystem) MkdirAll(path string, perm os.FileMode) error
- func (fs *FakeFileSystem) OpenFile(path string, flag int, perm os.FileMode) (boshsys.File, error)
- func (fs *FakeFileSystem) ReadFile(path string) ([]byte, error)
- func (fs *FakeFileSystem) ReadFileString(path string) (string, error)
- func (fs *FakeFileSystem) ReadLink(symlinkPath string) (string, error)
- func (fs *FakeFileSystem) RegisterMkdirAllError(path string, err error)
- func (fs *FakeFileSystem) RegisterOpenFile(path string, file *FakeFile)
- func (fs *FakeFileSystem) RegisterReadFileError(path string, err error)
- func (fs *FakeFileSystem) RegisterRemoveAllError(path string, err error)
- func (fs *FakeFileSystem) RemoveAll(path string) error
- func (fs *FakeFileSystem) Rename(oldPath, newPath string) error
- func (fs *FakeFileSystem) SetGlob(pattern string, matches ...[]string)
- func (fs *FakeFileSystem) Symlink(oldPath, newPath string) (err error)
- func (fs *FakeFileSystem) TempDir(prefix string) (string, error)
- func (fs *FakeFileSystem) TempFile(prefix string) (file boshsys.File, err error)
- func (fs *FakeFileSystem) Walk(root string, walkFunc filepath.WalkFunc) error
- func (fs *FakeFileSystem) WriteFile(path string, content []byte) (err error)
- func (fs *FakeFileSystem) WriteFileString(path, content string) (err error)
- type FakeFileType
- type FakeProcess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeCmdResult ¶
type FakeCmdRunner ¶
type FakeCmdRunner struct { RunComplexCommands []boshsys.Command RunCommands [][]string RunCommandsWithInput [][]string CommandExistsValue bool AvailableCommands map[string]bool // contains filtered or unexported fields }
func NewFakeCmdRunner ¶
func NewFakeCmdRunner() *FakeCmdRunner
func (*FakeCmdRunner) AddCmdResult ¶
func (r *FakeCmdRunner) AddCmdResult(fullCmd string, result FakeCmdResult)
func (*FakeCmdRunner) AddProcess ¶
func (r *FakeCmdRunner) AddProcess(fullCmd string, process *FakeProcess)
func (*FakeCmdRunner) CommandExists ¶
func (r *FakeCmdRunner) CommandExists(cmdName string) bool
func (*FakeCmdRunner) RunCommand ¶
func (*FakeCmdRunner) RunCommandWithInput ¶
func (*FakeCmdRunner) RunComplexCommand ¶
func (*FakeCmdRunner) RunComplexCommandAsync ¶
type FakeFile ¶
type FakeFile struct { Stats *FakeFileStats WriteErr error Contents []byte ReadErr error ReadAtErr error CloseErr error StatErr error // contains filtered or unexported fields }
func NewFakeFile ¶
func NewFakeFile(path string, fs *FakeFileSystem) *FakeFile
type FakeFileInfo ¶
func (FakeFileInfo) IsDir ¶
func (fi FakeFileInfo) IsDir() bool
func (FakeFileInfo) Size ¶
func (fi FakeFileInfo) Size() int64
type FakeFileStats ¶
type FakeFileStats struct { FileType FakeFileType FileMode os.FileMode Username string SymlinkTarget string Content []byte }
func (FakeFileStats) StringContents ¶
func (stats FakeFileStats) StringContents() string
type FakeFileSystem ¶
type FakeFileSystem struct { HomeDirUsername string HomeDirHomePath string ExpandPathPath string ExpandPathExpanded string ExpandPathErr error OpenFileErr error ReadFileError error WriteFileError error WriteFileErrors map[string]error SymlinkError error MkdirAllError error ChownErr error ChmodErr error CopyFileError error CopyDirError error RenameError error RenameOldPaths []string RenameNewPaths []string RemoveAllError error ReadLinkError error TempFileError error ReturnTempFile boshsys.File TempDirDir string TempDirDirs []string TempDirError error GlobErr error WalkErr error // contains filtered or unexported fields }
func NewFakeFileSystem ¶
func NewFakeFileSystem() *FakeFileSystem
func (*FakeFileSystem) Chown ¶
func (fs *FakeFileSystem) Chown(path, username string) error
func (*FakeFileSystem) ConvergeFileContents ¶
func (fs *FakeFileSystem) ConvergeFileContents(path string, content []byte) (bool, error)
func (*FakeFileSystem) CopyDir ¶
func (fs *FakeFileSystem) CopyDir(srcPath, dstPath string) error
func (*FakeFileSystem) CopyFile ¶
func (fs *FakeFileSystem) CopyFile(srcPath, dstPath string) error
func (*FakeFileSystem) ExpandPath ¶
func (fs *FakeFileSystem) ExpandPath(path string) (string, error)
func (*FakeFileSystem) FileExists ¶
func (fs *FakeFileSystem) FileExists(path string) bool
func (*FakeFileSystem) GetFileTestStat ¶
func (fs *FakeFileSystem) GetFileTestStat(path string) *FakeFileStats
func (*FakeFileSystem) Glob ¶
func (fs *FakeFileSystem) Glob(pattern string) (matches []string, err error)
func (*FakeFileSystem) MkdirAll ¶
func (fs *FakeFileSystem) MkdirAll(path string, perm os.FileMode) error
func (*FakeFileSystem) ReadFileString ¶
func (fs *FakeFileSystem) ReadFileString(path string) (string, error)
func (*FakeFileSystem) ReadLink ¶
func (fs *FakeFileSystem) ReadLink(symlinkPath string) (string, error)
func (*FakeFileSystem) RegisterMkdirAllError ¶
func (fs *FakeFileSystem) RegisterMkdirAllError(path string, err error)
func (*FakeFileSystem) RegisterOpenFile ¶
func (fs *FakeFileSystem) RegisterOpenFile(path string, file *FakeFile)
func (*FakeFileSystem) RegisterReadFileError ¶
func (fs *FakeFileSystem) RegisterReadFileError(path string, err error)
func (*FakeFileSystem) RegisterRemoveAllError ¶
func (fs *FakeFileSystem) RegisterRemoveAllError(path string, err error)
func (*FakeFileSystem) RemoveAll ¶
func (fs *FakeFileSystem) RemoveAll(path string) error
func (*FakeFileSystem) Rename ¶
func (fs *FakeFileSystem) Rename(oldPath, newPath string) error
func (*FakeFileSystem) SetGlob ¶
func (fs *FakeFileSystem) SetGlob(pattern string, matches ...[]string)
func (*FakeFileSystem) Symlink ¶
func (fs *FakeFileSystem) Symlink(oldPath, newPath string) (err error)
func (*FakeFileSystem) TempFile ¶
func (fs *FakeFileSystem) TempFile(prefix string) (file boshsys.File, err error)
func (*FakeFileSystem) Walk ¶
func (fs *FakeFileSystem) Walk(root string, walkFunc filepath.WalkFunc) error
func (*FakeFileSystem) WriteFile ¶
func (fs *FakeFileSystem) WriteFile(path string, content []byte) (err error)
func (*FakeFileSystem) WriteFileString ¶
func (fs *FakeFileSystem) WriteFileString(path, content string) (err error)
type FakeFileType ¶
type FakeFileType string
const ( FakeFileTypeFile FakeFileType = "file" FakeFileTypeSymlink FakeFileType = "symlink" FakeFileTypeDir FakeFileType = "dir" )
type FakeProcess ¶
type FakeProcess struct { WaitCh chan boshsys.Result Waited bool WaitResult boshsys.Result TerminatedNicely bool TerminatedNicelyCallBack func(*FakeProcess) TerminateNicelyKillGracePeriod time.Duration TerminateNicelyErr error }
func (*FakeProcess) TerminateNicely ¶
func (p *FakeProcess) TerminateNicely(killGracePeriod time.Duration) error
func (*FakeProcess) Wait ¶
func (p *FakeProcess) Wait() <-chan boshsys.Result
Click to show internal directories.
Click to hide internal directories.