Versions in this module Expand all Collapse all v1 v1.0.1 Jun 12, 2025 v1.0.0 May 30, 2025 Changes in this version + type Client struct + func NewClient(cfg *Config) (*Client, error) + func (cl *Client) Close() error + func (cl *Client) OpenSession(ctx context.Context) (*Session, error) + func (cl *Client) Run(ctx context.Context, cmd *command.Command, dst any, opts ...RunOption) (*parser.RawResult, error) + type Config struct + Host string + Port int + User string + func NewConfig(user, host string, port int, opts ...ConfigOption) (*Config, error) + func (c *Config) ClientConfig() (*ssh.ClientConfig, error) + type ConfigOption func(*Config) error + func WithAgentAuth() ConfigOption + func WithEnvVars(envVars map[string]string) ConfigOption + func WithKeepAlive(keepAlive time.Duration) ConfigOption + func WithKeyBytesAuth(keyBytes []byte, passphrase string) ConfigOption + func WithKnownHosts(path string) ConfigOption + func WithMaxSessions(maxSessions int) ConfigOption + func WithPasswordAuth(password string) ConfigOption + func WithPort(p int) ConfigOption + func WithPrivateKeyPathAuth(path, passphrase string) ConfigOption + func WithRetry(count int, interval time.Duration) ConfigOption + func WithSudoPassword(password string) ConfigOption + func WithTimeout(timeout time.Duration) ConfigOption + func WithWorkdir(path string) ConfigOption + type RunOption func(*runConfig) + func WithEnvVar(key, value string) RunOption + func WithStderr(stderr io.Writer) RunOption + func WithStdin(stdin io.Reader) RunOption + func WithStdout(stdout io.Writer) RunOption + func WithStreaming() RunOption + func WithoutBuffering() RunOption + type SCPOption func(config *scpConfig) + func WithBufferSize(bufSize int) SCPOption + func WithScpBinPath(path string) SCPOption + type SCPTransfer struct + func NewSCPTransfer(client *Client) *SCPTransfer + func (t *SCPTransfer) Copy(ctx context.Context, spec *rexec.FileSpec, opts ...SCPOption) error + type SFTPOption func(*sftpConfig) + func WithSFTPBufferSize(n int) SFTPOption + type SFTPTransfer struct + func NewSFTPTransfer(client *Client) *SFTPTransfer + func (t *SFTPTransfer) Copy(ctx context.Context, spec *rexec.FileSpec, opts ...SFTPOption) error + type Session struct + func (w *Session) Close() error