Versions in this module Expand all Collapse all v1 v1.0.0 Jun 18, 2019 Changes in this version + func StartKeepalive(client *ssh.Client, interval time.Duration, countMax int, done <-chan struct{}) + type Cmd struct + Command string + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + func (c *Cmd) Wait() error + type Communicator struct + OnConnClose func(host string) + OnDial func(host string, err error) + func NewCommunicator(host string, config Config, dial DialContextFunc, logger Logger) *Communicator + func (c *Communicator) Connect(ctx context.Context) (err error) + func (c *Communicator) Disconnect() + func (c *Communicator) Start(ctx context.Context, cmd *Cmd) error + func (c *Communicator) Upload(ctx context.Context, path string, perm os.FileMode, src io.Reader) error + type Config struct + Port int + Pty bool + ServerAliveCountMax int + ServerAliveInterval time.Duration + func DefaultConfig() Config + func (c Config) KeepaliveEnabled() bool + func (c Config) Validate() (err error) + func (c Config) WithIdentityFileAuth(user string, identityFile []byte) (Config, error) + func (c Config) WithPasswordAuth(user, passwd string) Config + type DialContextFunc func(ctx context.Context, network, addr string, config *ssh.ClientConfig) (*ssh.Client, error) + func ContextDialer(dialer *net.Dialer) DialContextFunc + type ExitError struct + Command string + Err error + ExitStatus int + func (e *ExitError) Error() string + type Logger interface + Println func(v ...interface{})