Documentation
¶
Overview ¶
Package runner 封装系统 ssh/scp 子进程调用(非交互、超时、截断)。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MuxEnabled ¶
MuxEnabled 报告本次调用是否实际带上 ControlMaster 参数(目录不可写或 DisableMux 时为 false)。
func RemoteHome ¶
RemoteHome 通过 ssh 读取远端 $HOME。
func WrapWorkdir ¶
WrapWorkdir 生成:cd -- <dir> && <cmd>
Types ¶
type ExecResult ¶
type ExecResult struct {
ExitCode int
Stdout string
Stderr string
Truncated bool
// TimedOut 是否因超时被杀
TimedOut bool
// ConnectErr 是否更像连接/ssh 客户端失败(无远端退出码语义)
ConnectErr bool
}
ExecResult 远程命令结果。
func SCPGet ¶
func SCPGet(ctx context.Context, opt Options, host, remotePath, localPath string) (*ExecResult, error)
SCPGet 下载:scp [opts] host:remote local
Click to show internal directories.
Click to hide internal directories.