sshx

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(s *config.Server, opts DialOptions) (*ssh.Client, error)

Dial opens an SSH client for the given server entry.

func Download

func Download(client *ssh.Client, remotePath, localPath string) error

Download copies remotePath to localPath via SFTP.

func Run

func Run(client *ssh.Client, command string) (int, error)

Run executes a remote command and streams stdout/stderr to the local process.

func Shell

func Shell(client *ssh.Client) error

Shell starts an interactive login shell with PTY.

func Upload

func Upload(client *ssh.Client, localPath, remotePath string) error

Upload copies localPath to remotePath via SFTP (SCP-compatible usage).

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

type SyncOptions struct {
	Delete   bool
	DryRun   bool
	Checksum bool
	Progress io.Writer
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL