Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CmdRunner ¶
type CmdRunner interface { // RunComplexCommand returns error as nil: // - command runs and exits with a zero exit status // RunComplexCommand returns error: // - command runs and exits with a non-zero exit status // - command does not run RunComplexCommand(cmd Command) (stdout, stderr string, exitStatus int, err error) RunComplexCommandAsync(cmd Command) (Process, error) RunCommand(cmdName string, args ...string) (stdout, stderr string, exitStatus int, err error) RunCommandWithInput(input, cmdName string, args ...string) (stdout, stderr string, exitStatus int, err error) CommandExists(cmdName string) (exists bool) }
func NewExecCmdRunner ¶
type ExecError ¶
type ExecError struct {
// contains filtered or unexported fields
}
func NewExecError ¶
func (ExecError) ShortError ¶
ShortError returns an error message that has stdout/stderr truncated.
type FileSystem ¶
type FileSystem interface { HomeDir(username string) (path string, err error) // MkdirAll will not change existing dir permissions // if dir exists and has different permissions MkdirAll(path string, perm os.FileMode) (err error) RemoveAll(fileOrDir string) (err error) Chown(path, username string) (err error) Chmod(path string, perm os.FileMode) (err error) OpenFile(path string, flag int, perm os.FileMode) (ReadWriteCloseStater, error) WriteFileString(path, content string) (err error) WriteFile(path string, content []byte) (err error) ConvergeFileContents(path string, content []byte) (written bool, err error) ReadFileString(path string) (content string, err error) ReadFile(path string) (content []byte, err error) FileExists(path string) bool Rename(oldPath, newPath string) (err error) // After Symlink file at newPath will be pointing to file at oldPath. // Symlink call will remove file at newPath if one exists // to make newPath a symlink to the file at oldPath. Symlink(oldPath, newPath string) (err error) ReadLink(symlinkPath string) (targetPath string, err error) CopyFile(srcPath, dstPath string) (err error) // Returns *unique* temporary file/dir with a custom prefix TempFile(prefix string) (file *os.File, err error) TempDir(prefix string) (path string, err error) Glob(pattern string) (matches []string, err error) Walk(root string, walkFunc filepath.WalkFunc) error }
func NewOsFileSystem ¶
func NewOsFileSystem(logger boshlog.Logger) FileSystem
type ReadWriteCloseStater ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.