Documentation
¶
Index ¶
- func New(config Config) (transport.Transport, error)
- type Config
- type Transport
- func (t *Transport) Close(ctx context.Context) error
- func (t *Transport) Download(ctx context.Context, req transport.DownloadRequest) (*transport.TransferResult, error)
- func (t *Transport) Exec(ctx context.Context, req transport.ExecRequest) (*transport.ExecResult, error)
- func (t *Transport) Upload(ctx context.Context, req transport.UploadRequest) (*transport.TransferResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Host string
Port int
User string
Password string
PrivateKey []byte
PrivateKeyPath string
Passphrase []byte
KnownHostsPath string
InsecureIgnoreHostKey bool
Timeout time.Duration
}
Config holds the configuration for connecting to an SSH server.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is an SSH-based transport that executes commands on a remote host and transfers files via SFTP.
func (*Transport) Close ¶
Close closes the underlying SSH client connection. It is safe to call multiple times; subsequent calls are no-ops.
func (*Transport) Download ¶
func (t *Transport) Download(ctx context.Context, req transport.DownloadRequest) (*transport.TransferResult, error)
Download copies a remote file to the local host via SFTP.
func (*Transport) Exec ¶
func (t *Transport) Exec(ctx context.Context, req transport.ExecRequest) (*transport.ExecResult, error)
Exec runs a command on the remote host via SSH.
func (*Transport) Upload ¶
func (t *Transport) Upload(ctx context.Context, req transport.UploadRequest) (*transport.TransferResult, error)
Upload copies a local file to the remote host via SFTP.
Click to show internal directories.
Click to hide internal directories.