ssh

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package ssh implements SSH-based remote host connectivity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Probe

func Probe(ctx context.Context, connection Connection) error

Runs a trivial echo command over shh to verify the connection is healthy and the remote shell is functional.

Types

type Connection

type Connection interface {
	Executor
	FileTransfer
	Close() error
}

type DialConfig

type DialConfig struct {
	Address        string
	Port           int
	User           string
	PrivateKeyFile string
	KnownHostsFile string
	HostKeyPolicy  string
}

type Dialer

type Dialer interface {
	Dial(ctx context.Context, config DialConfig) (Connection, error)
}

func NewDialer

func NewDialer() Dialer

type Executor

type Executor interface {
	Run(ctx context.Context, cmd string) (stdout, stderr string, err error)
}

Executor runs commands on a remote host.

type FileTransfer

type FileTransfer interface {
	Upload(ctx context.Context, localPath, remotePath string) error
}

FileTransfer copies files to a remote host.

Jump to

Keyboard shortcuts

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