Documentation
¶
Index ¶
- func Args(cc ConnConfig) []string
- func Console(cc ConnConfig, remoteCmd string) error
- func Exec(ctx context.Context, cc ConnConfig, command []string) (int, error)
- func ExecQuiet(ctx context.Context, cc ConnConfig, command []string) (int, error)
- func Output(ctx context.Context, cc ConnConfig, command []string) ([]byte, error)
- func OutputQuiet(ctx context.Context, cc ConnConfig, command []string) ([]byte, error)
- func TestAuth(ctx context.Context, cc ConnConfig) error
- func WaitReady(ctx context.Context, host string, timeout time.Duration, log io.Writer) error
- type ConnConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Args ¶ added in v0.5.0
func Args(cc ConnConfig) []string
Args builds the SSH command-line arguments for the given connection config. It is exported for use by callers that need to construct custom exec.Cmd with non-standard Stdin/Stdout/Stderr (e.g. sandbox backends).
func Console ¶
func Console(cc ConnConfig, remoteCmd string) error
Console replaces the current process with an interactive SSH session. If remoteCmd is non-empty, it is executed in a forced PTY on the remote host.
func ExecQuiet ¶ added in v0.3.0
ExecQuiet runs a non-interactive command on the remote host via SSH and returns its exit code. Unlike Exec, it does not attach stdin/stdout/stderr.
func OutputQuiet ¶ added in v0.3.0
OutputQuiet runs a command on the remote host via SSH and returns its stdout, discarding stderr. Use this when parsing command output programmatically.