Documentation
¶
Index ¶
- func Dial(s *config.Server, opts DialOptions) (*ssh.Client, error)
- func Download(client *ssh.Client, remotePath, localPath string) error
- func Run(client *ssh.Client, command string) (int, error)
- func Shell(client *ssh.Client) error
- func Upload(client *ssh.Client, localPath, remotePath string) error
- type DialOptions
- type SyncOptions
- type SyncStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DialOptions ¶
type DialOptions struct {
Timeout time.Duration
Insecure bool // skip host key verification (CLI default)
}
DialOptions controls SSH connection behavior.
type SyncOptions ¶ added in v0.3.0
SyncOptions controls incremental local-to-remote synchronization.
type SyncStats ¶ added in v0.3.0
type SyncStats struct {
Scanned int `json:"scanned"`
Uploaded int `json:"uploaded"`
Skipped int `json:"skipped"`
Deleted int `json:"deleted"`
BytesTransferred int64 `json:"bytes_transferred"`
}
SyncStats summarizes one synchronization run.
func SyncUpload ¶ added in v0.3.0
func SyncUpload(client *ssh.Client, localPath, remotePath string, opts SyncOptions) (SyncStats, error)
SyncUpload incrementally copies a local file or directory to a remote path over SFTP. Directory contents are placed directly under remotePath, matching rsync's trailing-slash use.