Documentation
¶
Index ¶
- type CommandExecutor
- type EnvProvider
- type IOStreamsProvider
- type OsExecutor
- type RealOsExecutor
- func (ex *RealOsExecutor) AppendToFile(path string, data []byte, perm os.FileMode) error
- func (ex *RealOsExecutor) Args() []string
- func (ex *RealOsExecutor) Chdir(dir string) error
- func (ex *RealOsExecutor) Chmod(name string, mode os.FileMode) error
- func (ex *RealOsExecutor) CopyDir(src, dst string) error
- func (ex *RealOsExecutor) CopyFile(src, dst string) error
- func (ex *RealOsExecutor) CopyLink(src, dst string) error
- func (ex *RealOsExecutor) Create(name string) (*os.File, error)
- func (ex *RealOsExecutor) CurrentUser() (*user.User, error)
- func (ex *RealOsExecutor) Execute(cmd string, arg, env []string, dir string) ([]byte, []byte, error)
- func (ex *RealOsExecutor) ExecuteContext(ctx context.Context, cmd string, arg, env []string, dir string) ([]byte, []byte, error)
- func (ex *RealOsExecutor) ExecuteWithStreams(cmd string, arg, env []string, dir string, stdout io.Writer, stderr io.Writer) error
- func (ex *RealOsExecutor) ExecuteWithStreamsContext(ctx context.Context, cmd string, arg, env []string, dir string, ...) error
- func (ex *RealOsExecutor) Exit(statusCode int)
- func (ex *RealOsExecutor) ExpandTilde(path string) (string, error)
- func (ex *RealOsExecutor) GetOS() string
- func (ex *RealOsExecutor) Getenv(key string) string
- func (ex *RealOsExecutor) Getwd() (string, error)
- func (ex *RealOsExecutor) IsDir(path string) error
- func (ex *RealOsExecutor) IsExist(err error) bool
- func (ex *RealOsExecutor) IsFile(path string) error
- func (ex *RealOsExecutor) IsNotExist(err error) bool
- func (ex *RealOsExecutor) Lstat(name string) (os.FileInfo, error)
- func (ex *RealOsExecutor) Mkdir(dirname string, perm os.FileMode) error
- func (ex *RealOsExecutor) MkdirAll(path string, perm os.FileMode) error
- func (ex *RealOsExecutor) Open(name string) (*os.File, error)
- func (ex *RealOsExecutor) OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)
- func (ex *RealOsExecutor) ReadDir(dirname string) ([]os.DirEntry, error)
- func (ex *RealOsExecutor) ReadFile(filename string) ([]byte, error)
- func (ex *RealOsExecutor) Readlink(name string) (string, error)
- func (ex *RealOsExecutor) Remove(path string) error
- func (ex *RealOsExecutor) RemoveAll(path string) error
- func (ex *RealOsExecutor) RemoveContents(path string, limit int) error
- func (ex *RealOsExecutor) Rename(oldPath, newPath string) error
- func (ex *RealOsExecutor) ResolvePath(path string) (string, error)
- func (ex *RealOsExecutor) SetStderr(v io.Writer)
- func (ex *RealOsExecutor) SetStdin(v io.Reader)
- func (ex *RealOsExecutor) SetStdout(v io.Writer)
- func (ex *RealOsExecutor) Setenv(key, value string) error
- func (ex *RealOsExecutor) Stat(filename string) (os.FileInfo, error)
- func (ex *RealOsExecutor) Stderr() io.Writer
- func (ex *RealOsExecutor) Stdin() io.Reader
- func (ex *RealOsExecutor) Stdout() io.Writer
- func (ex *RealOsExecutor) Symlink(oldname, newname string) error
- func (ex *RealOsExecutor) TempDir(dir, prefix string) (string, error)
- func (ex *RealOsExecutor) TempFile(dir, pattern string) (*os.File, error)
- func (ex *RealOsExecutor) UserHomeDir() (string, error)
- func (ex *RealOsExecutor) WriteFile(path string, data []byte, perm os.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandExecutor ¶
type EnvProvider ¶
type IOStreamsProvider ¶
type OsExecutor ¶
type OsExecutor interface {
AppendToFile(path string, data []byte, perm os.FileMode) error
Args() []string
Chdir(dir string) error
Chmod(name string, mode os.FileMode) error
CopyDir(src, dst string) error
CopyFile(src, dst string) error
CopyLink(src, dst string) error
Create(name string) (*os.File, error)
CurrentUser() (*user.User, error)
ExecuteWithStreams(cmd string, arg, env []string, dir string, stdout, stderr io.Writer) error
ExecuteWithStreamsContext(ctx context.Context, cmd string, arg, env []string, dir string, stdout, stderr io.Writer) error
Exit(statusCode int)
ExpandTilde(path string) (string, error)
Getenv(key string) string
Setenv(key, value string) error
GetOS() string
Getwd() (string, error)
UserHomeDir() (string, error)
IsDir(path string) error
IsExist(err error) bool
IsFile(path string) error
IsNotExist(err error) bool
Lstat(name string) (os.FileInfo, error)
Mkdir(dirname string, perm os.FileMode) error
MkdirAll(dirname string, perm os.FileMode) error
Open(name string) (*os.File, error)
OpenFile(path string, flag int, perm os.FileMode) (*os.File, error)
ReadDir(dirname string) ([]os.DirEntry, error)
ReadFile(filename string) ([]byte, error)
Readlink(name string) (string, error)
Remove(path string) error
RemoveAll(path string) error
RemoveContents(path string, limit int) error
Rename(oldPath, newPath string) error
ResolvePath(path string) (string, error)
SetStderr(v io.Writer)
SetStdin(v io.Reader)
SetStdout(v io.Writer)
Stat(filepath string) (os.FileInfo, error)
Stderr() io.Writer
Stdin() io.Reader
Stdout() io.Writer
Symlink(oldname, newname string) error
TempDir(dir, prefix string) (string, error)
TempFile(dir, pattern string) (*os.File, error)
WriteFile(path string, data []byte, perm os.FileMode) error
CommandExecutor
}
type RealOsExecutor ¶
type RealOsExecutor struct {
// contains filtered or unexported fields
}
func (*RealOsExecutor) AppendToFile ¶
func (*RealOsExecutor) Args ¶
func (ex *RealOsExecutor) Args() []string
func (*RealOsExecutor) Chdir ¶
func (ex *RealOsExecutor) Chdir(dir string) error
func (*RealOsExecutor) CopyDir ¶
func (ex *RealOsExecutor) CopyDir(src, dst string) error
func (*RealOsExecutor) CopyFile ¶
func (ex *RealOsExecutor) CopyFile(src, dst string) error
func (*RealOsExecutor) CopyLink ¶
func (ex *RealOsExecutor) CopyLink(src, dst string) error
func (*RealOsExecutor) CurrentUser ¶
func (ex *RealOsExecutor) CurrentUser() (*user.User, error)
func (*RealOsExecutor) ExecuteContext ¶
func (*RealOsExecutor) ExecuteWithStreams ¶
func (*RealOsExecutor) ExecuteWithStreamsContext ¶
func (*RealOsExecutor) Exit ¶
func (ex *RealOsExecutor) Exit(statusCode int)
func (*RealOsExecutor) ExpandTilde ¶
func (ex *RealOsExecutor) ExpandTilde(path string) (string, error)
func (*RealOsExecutor) GetOS ¶
func (ex *RealOsExecutor) GetOS() string
func (*RealOsExecutor) Getenv ¶
func (ex *RealOsExecutor) Getenv(key string) string
func (*RealOsExecutor) Getwd ¶
func (ex *RealOsExecutor) Getwd() (string, error)
func (*RealOsExecutor) IsDir ¶
func (ex *RealOsExecutor) IsDir(path string) error
func (*RealOsExecutor) IsExist ¶
func (ex *RealOsExecutor) IsExist(err error) bool
func (*RealOsExecutor) IsFile ¶
func (ex *RealOsExecutor) IsFile(path string) error
func (*RealOsExecutor) IsNotExist ¶
func (ex *RealOsExecutor) IsNotExist(err error) bool
func (*RealOsExecutor) Mkdir ¶
func (ex *RealOsExecutor) Mkdir(dirname string, perm os.FileMode) error
func (*RealOsExecutor) MkdirAll ¶
func (ex *RealOsExecutor) MkdirAll(path string, perm os.FileMode) error
func (*RealOsExecutor) ReadDir ¶
func (ex *RealOsExecutor) ReadDir(dirname string) ([]os.DirEntry, error)
func (*RealOsExecutor) ReadFile ¶
func (ex *RealOsExecutor) ReadFile(filename string) ([]byte, error)
func (*RealOsExecutor) Remove ¶
func (ex *RealOsExecutor) Remove(path string) error
func (*RealOsExecutor) RemoveAll ¶
func (ex *RealOsExecutor) RemoveAll(path string) error
func (*RealOsExecutor) RemoveContents ¶
func (ex *RealOsExecutor) RemoveContents(path string, limit int) error
func (*RealOsExecutor) Rename ¶
func (ex *RealOsExecutor) Rename(oldPath, newPath string) error
func (*RealOsExecutor) ResolvePath ¶
func (ex *RealOsExecutor) ResolvePath(path string) (string, error)
func (*RealOsExecutor) SetStderr ¶
func (ex *RealOsExecutor) SetStderr(v io.Writer)
func (*RealOsExecutor) SetStdin ¶
func (ex *RealOsExecutor) SetStdin(v io.Reader)
func (*RealOsExecutor) SetStdout ¶
func (ex *RealOsExecutor) SetStdout(v io.Writer)
func (*RealOsExecutor) Setenv ¶
func (ex *RealOsExecutor) Setenv(key, value string) error
func (*RealOsExecutor) Stderr ¶
func (ex *RealOsExecutor) Stderr() io.Writer
func (*RealOsExecutor) Stdin ¶
func (ex *RealOsExecutor) Stdin() io.Reader
func (*RealOsExecutor) Stdout ¶
func (ex *RealOsExecutor) Stdout() io.Writer
func (*RealOsExecutor) Symlink ¶
func (ex *RealOsExecutor) Symlink(oldname, newname string) error
func (*RealOsExecutor) TempDir ¶
func (ex *RealOsExecutor) TempDir(dir, prefix string) (string, error)
func (*RealOsExecutor) TempFile ¶
func (ex *RealOsExecutor) TempFile(dir, pattern string) (*os.File, error)
func (*RealOsExecutor) UserHomeDir ¶
func (ex *RealOsExecutor) UserHomeDir() (string, error)
Click to show internal directories.
Click to hide internal directories.