Documentation
¶
Overview ¶
Package sshx implements the managed ssh/scp/sftp surface: system OpenSSH client, ssh-domain authorization, and local fs preflight delegated to the embedding host.
Index ¶
- func TrustedBinary() (string, error)
- type Deps
- type ProcessRunner
- type Runner
- func (r *Runner) Options(ctx context.Context, raw string, port int) (vbox.StartOptions, error)
- func (r *Runner) Run(ctx context.Context, opts vbox.StartOptions, in io.Reader, ...) (int, error)
- func (s *Runner) SCP(ctx context.Context, inv *commands.Invocation) error
- func (s *Runner) SFTP(ctx context.Context, inv *commands.Invocation) error
- func (r *Runner) SSH(ctx context.Context, inv *commands.Invocation) error
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
Processes *vbox.Manager
// Run 覆盖进程执行(测试注入);nil 用 Processes。
Run ProcessRunner
// Allowed 判定 ssh 域目标准入(host 接 permissionState.sshAllowed)。
Allowed func(ctx context.Context, hostport string) bool
// CheckLocal 是本地路径的 fs 域预检(scp/sftp 读写前)。
CheckLocal func(ctx context.Context, inv *commands.Invocation, name string, write bool) error
}
Deps 是 Runner 的宿主依赖。
type ProcessRunner ¶
type ProcessRunner func(context.Context, vbox.StartOptions, io.Reader, io.Writer, io.Writer) (int, error)
ProcessRunner 是 SSH 传输进程的执行入口(host 注入 procs 或测试替身)。
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner 是托管 SSH 命令面的执行器(ssh/scp/sftp 共用)。
func (*Runner) Run ¶
func (r *Runner) Run(ctx context.Context, opts vbox.StartOptions, in io.Reader, out, errout io.Writer) (int, error)
Run 执行一次 SSH 传输进程。
Click to show internal directories.
Click to hide internal directories.