Documentation ¶
Index ¶
- type FakeCmdCallback
- type FakeCmdResult
- type FakeCmdRunner
- func (r *FakeCmdRunner) AddCmdResult(fullCmd string, result FakeCmdResult)
- func (r *FakeCmdRunner) AddProcess(fullCmd string, process *FakeProcess)
- func (r *FakeCmdRunner) ClearCommandHistory()
- func (r *FakeCmdRunner) CommandExists(cmdName string) bool
- func (r *FakeCmdRunner) RunCommand(cmdName string, args ...string) (string, string, int, error)
- func (r *FakeCmdRunner) RunCommandQuietly(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)
- func (r *FakeCmdRunner) SetCmdCallback(fullCmd string, callback FakeCmdCallback)
- type FakeFile
- func (f *FakeFile) Close() error
- func (f *FakeFile) Name() string
- func (f *FakeFile) Read(b []byte) (int, error)
- func (f *FakeFile) ReadAt(b []byte, offset int64) (int, error)
- func (f *FakeFile) Seek(offset int64, whence int) (int64, error)
- func (f FakeFile) Stat() (os.FileInfo, error)
- func (f *FakeFile) Write(contents []byte) (int, error)
- func (f *FakeFile) WriteAt(b []byte, offset int64) (int, error)
- type FakeFileInfo
- type FakeFileRegistry
- type FakeFileStats
- type FakeFileStatsRegistry
- func (fsr *FakeFileStatsRegistry) Get(path string) *FakeFileStats
- func (fsr *FakeFileStatsRegistry) GetAll() map[string]*FakeFileStats
- func (fsr *FakeFileStatsRegistry) Register(path string, stats *FakeFileStats)
- func (fsr *FakeFileStatsRegistry) Remove(path string)
- func (fsr *FakeFileStatsRegistry) UnifiedPath(path string) string
- type FakeFileSystem
- func (fs *FakeFileSystem) ChangeTempRoot(tempRootPath string) error
- 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, opts ...boshsys.ConvergeFileContentsOpts) (bool, error)
- func (fs *FakeFileSystem) CopyDir(srcPath, dstPath string) error
- func (fs *FakeFileSystem) CopyFile(srcPath, dstPath string) error
- func (fs *FakeFileSystem) EnableStrictTempRootBehavior()
- func (fs *FakeFileSystem) ExpandPath(path string) (string, error)
- func (fs *FakeFileSystem) FileExists(path string) bool
- func (fs *FakeFileSystem) FindFileStats(path string) (*FakeFileStats, error)
- 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) Ls(root string) ([]string, error)
- func (fs *FakeFileSystem) Lstat(path string) (os.FileInfo, 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) ReadAndFollowLink(symlinkPath string) (string, error)
- func (fs *FakeFileSystem) ReadFile(path string) ([]byte, error)
- func (fs *FakeFileSystem) ReadFileString(path string) (string, error)
- func (fs *FakeFileSystem) ReadFileWithOpts(path string, opts boshsys.ReadOpts) ([]byte, error)
- func (fs *FakeFileSystem) Readlink(symlinkPath string) (string, error)
- func (fs *FakeFileSystem) RecursiveGlob(pattern string) (matches []string, err 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) RemoveAll(path string) error
- func (fs *FakeFileSystem) Rename(oldPath, newPath string) error
- func (fs *FakeFileSystem) SetGlob(pattern string, matches ...[]string)
- func (fs *FakeFileSystem) Stat(path string) (os.FileInfo, error)
- func (fs *FakeFileSystem) StatHelper(path string) (os.FileInfo, error)
- func (fs *FakeFileSystem) StatWithOpts(path string, opts boshsys.StatOpts) (os.FileInfo, error)
- 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) UnregisterReadFileError(path string)
- func (fs *FakeFileSystem) Walk(root string, walkFunc filepath.WalkFunc) error
- func (fs *FakeFileSystem) WriteFile(path string, content []byte) error
- func (fs *FakeFileSystem) WriteFileQuietly(path string, content []byte) error
- func (fs *FakeFileSystem) WriteFileString(path, content string) error
- type FakeFileType
- type FakeProcess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeCmdCallback ¶
type FakeCmdCallback func()
type FakeCmdResult ¶
type FakeCmdRunner ¶
type FakeCmdRunner struct { RunComplexCommands []boshsys.Command RunCommands [][]string RunCommandsWithInput [][]string RunCommandsQuietly [][]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) ClearCommandHistory ¶
func (r *FakeCmdRunner) ClearCommandHistory()
func (*FakeCmdRunner) CommandExists ¶
func (r *FakeCmdRunner) CommandExists(cmdName string) bool
func (*FakeCmdRunner) RunCommand ¶
func (*FakeCmdRunner) RunCommandQuietly ¶
func (*FakeCmdRunner) RunCommandWithInput ¶
func (*FakeCmdRunner) RunComplexCommand ¶
func (*FakeCmdRunner) RunComplexCommandAsync ¶
func (*FakeCmdRunner) SetCmdCallback ¶
func (r *FakeCmdRunner) SetCmdCallback(fullCmd string, callback FakeCmdCallback)
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) ModTime ¶
func (fi FakeFileInfo) ModTime() time.Time
func (FakeFileInfo) Mode ¶
func (fi FakeFileInfo) Mode() os.FileMode
func (FakeFileInfo) Size ¶
func (fi FakeFileInfo) Size() int64
type FakeFileRegistry ¶
type FakeFileRegistry struct {
// contains filtered or unexported fields
}
func NewFakeFileRegistry ¶
func NewFakeFileRegistry() *FakeFileRegistry
func (*FakeFileRegistry) Get ¶
func (ffr *FakeFileRegistry) Get(path string) *FakeFile
func (*FakeFileRegistry) Register ¶
func (ffr *FakeFileRegistry) Register(path string, file *FakeFile)
func (*FakeFileRegistry) Remove ¶
func (ffr *FakeFileRegistry) Remove(path string)
func (*FakeFileRegistry) UnifiedPath ¶
func (ffr *FakeFileRegistry) UnifiedPath(path string) string
type FakeFileStats ¶
type FakeFileStats struct { FileType FakeFileType FileMode os.FileMode Flags int Username string Groupname string ModTime time.Time Open bool SymlinkTarget string Content []byte }
func (FakeFileStats) StringContents ¶
func (stats FakeFileStats) StringContents() string
type FakeFileStatsRegistry ¶
type FakeFileStatsRegistry struct {
// contains filtered or unexported fields
}
func NewFakeFileStatsRegistry ¶
func NewFakeFileStatsRegistry() *FakeFileStatsRegistry
func (*FakeFileStatsRegistry) Get ¶
func (fsr *FakeFileStatsRegistry) Get(path string) *FakeFileStats
func (*FakeFileStatsRegistry) GetAll ¶
func (fsr *FakeFileStatsRegistry) GetAll() map[string]*FakeFileStats
func (*FakeFileStatsRegistry) Register ¶
func (fsr *FakeFileStatsRegistry) Register(path string, stats *FakeFileStats)
func (*FakeFileStatsRegistry) Remove ¶
func (fsr *FakeFileStatsRegistry) Remove(path string)
func (*FakeFileStatsRegistry) UnifiedPath ¶
func (fsr *FakeFileStatsRegistry) UnifiedPath(path string) string
type FakeFileSystem ¶
type FakeFileSystem struct { HomeDirUsername string HomeDirHomePath string ExpandPathPath string ExpandPathExpanded string ExpandPathErr error OpenFileErr error ReadFileError error ReadFileWithOptsCallCount int WriteFileError error WriteFileErrors map[string]error WriteFileCallCount int WriteFileQuietlyCallCount int SymlinkError error MkdirAllError error MkdirAllCallCount int ChangeTempRootErr error ChownErr error ChownCallCount int ChmodErr error ChmodCallCount int CopyFileError error CopyFileCallCount int CopyDirError error RenameStub renameFn RenameError error RenameOldPaths []string RenameNewPaths []string RemoveAllStub removeAllFn ReadAndFollowLinkError error ReadlinkError error StatWithOptsCallCount int StatCallCount int TempFileError error TempFileErrorsByPrefix map[string]error ReturnTempFile boshsys.File ReturnTempFiles []boshsys.File ReturnTempFilesByPrefix map[string]boshsys.File TempDirDir string TempDirDirs []string TempDirError error GlobErr error GlobStub globFn GlobErrs map[string]error WalkErr error TempRootPath string // contains filtered or unexported fields }
func NewFakeFileSystem ¶
func NewFakeFileSystem() *FakeFileSystem
func (*FakeFileSystem) ChangeTempRoot ¶
func (fs *FakeFileSystem) ChangeTempRoot(tempRootPath string) error
func (*FakeFileSystem) Chown ¶
func (fs *FakeFileSystem) Chown(path, username string) error
func (*FakeFileSystem) ConvergeFileContents ¶
func (fs *FakeFileSystem) ConvergeFileContents(path string, content []byte, opts ...boshsys.ConvergeFileContentsOpts) (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) EnableStrictTempRootBehavior ¶
func (fs *FakeFileSystem) EnableStrictTempRootBehavior()
func (*FakeFileSystem) ExpandPath ¶
func (fs *FakeFileSystem) ExpandPath(path string) (string, error)
func (*FakeFileSystem) FileExists ¶
func (fs *FakeFileSystem) FileExists(path string) bool
func (*FakeFileSystem) FindFileStats ¶
func (fs *FakeFileSystem) FindFileStats(path string) (*FakeFileStats, error)
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) ReadAndFollowLink ¶
func (fs *FakeFileSystem) ReadAndFollowLink(symlinkPath string) (string, error)
func (*FakeFileSystem) ReadFileString ¶
func (fs *FakeFileSystem) ReadFileString(path string) (string, error)
func (*FakeFileSystem) ReadFileWithOpts ¶
func (*FakeFileSystem) Readlink ¶
func (fs *FakeFileSystem) Readlink(symlinkPath string) (string, error)
func (*FakeFileSystem) RecursiveGlob ¶
func (fs *FakeFileSystem) RecursiveGlob(pattern string) (matches []string, err 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) 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) StatHelper ¶
func (fs *FakeFileSystem) StatHelper(path string) (os.FileInfo, error)
func (*FakeFileSystem) StatWithOpts ¶
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) UnregisterReadFileError ¶
func (fs *FakeFileSystem) UnregisterReadFileError(path string)
func (*FakeFileSystem) Walk ¶
func (fs *FakeFileSystem) Walk(root string, walkFunc filepath.WalkFunc) error
func (*FakeFileSystem) WriteFile ¶
func (fs *FakeFileSystem) WriteFile(path string, content []byte) error
func (*FakeFileSystem) WriteFileQuietly ¶
func (fs *FakeFileSystem) WriteFileQuietly(path string, content []byte) error
func (*FakeFileSystem) WriteFileString ¶
func (fs *FakeFileSystem) WriteFileString(path, content string) error
type FakeFileType ¶
type FakeFileType string
const ( FakeFileTypeFile FakeFileType = "file" FakeFileTypeSymlink FakeFileType = "symlink" FakeFileTypeDir FakeFileType = "dir" )
type FakeProcess ¶
type FakeProcess struct { StartErr error WaitCh chan boshsys.Result Waited bool WaitResult boshsys.Result TerminatedNicely bool TerminatedNicelyCallBack func(*FakeProcess) TerminateNicelyKillGracePeriod time.Duration TerminateNicelyErr error Stdout io.Writer Stderr io.Writer }
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.