Documentation
¶
Index ¶
- func ExecShell(command string) (string, error)
- func ExecShellTimeout(command string, timeout time.Duration, ctx *ShellContext) (string, error)
- func ExecShellf(command string, args ...interface{}) (string, error)
- func GetCmdOutput(cmd *cmd.Cmd) string
- func Trunc(str string, num int) string
- type ShellContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecShellTimeout ¶
ExecShellTimeout execute a shell command (like bash -c 'your command') with a timeout. After that time, the process will be cancelled
func ExecShellf ¶
ExecShellf execute a shell command (like bash -c 'your command') but with format replacements
func GetCmdOutput ¶
GetCmdOutput join stdout and stderr in a single string from Cmd
Types ¶
type ShellContext ¶
type ShellContext struct {
//CmdRef cmd.Cmd pointer that can be used to set command references that should be killed when a backup deletion of a running job is detected
CmdRef *cmd.Cmd
}
ShellContext container to transport a Cmd reference
Click to show internal directories.
Click to hide internal directories.