Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConnBroken ¶ added in v0.5.1
IsConnBroken reports whether err indicates the underlying SSH transport is dead (as opposed to a command-level failure). Long migrations open thousands of sessions against the same connection; the target sshd, a network blip or an idle-timeout can tear the transport down mid-run. When that happens every later session/command fails until the connection is rebuilt, so these errors must trigger a reconnect rather than a plain retry.
Network-layer failures are matched against real error values via errors.Is/As (io.EOF, net.ErrClosed, the syscall errnos, the net.Error timeout interface), which is robust to wrapping. golang.org/x/crypto/ssh reports many channel- and session-level transport failures as plain unwrapped strings, so a lower-cased substring check is kept as a fallback for those.
Types ¶
type Client ¶
type Client struct {
*goph.Client
SSHTarget *model.SSHTarget
// contains filtered or unexported fields
}
func NewSSHClient ¶
func (*Client) NewSessionWithRetry ¶ added in v0.3.1
func (*Client) RunWithRetry ¶ added in v0.5.1
RunWithRetry runs cmd on the host and returns its combined output. Unlike the embedded goph Run, it rebuilds the connection and retries when the transport dies mid-run, so a single reset does not cascade into every remaining step.
type ConnectionType ¶ added in v0.2.1
type ConnectionType int
const ( ConnectionTypeSource ConnectionType = iota ConnectionTypeTarget )