Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyUsername = errors.New("empty username") ErrEmptyPassword = errors.New("empty password") ErrEmptyAddress = errors.New("empty hostname") ErrInvalidPort = errors.New("invalid port") ErrMissingIPv6Bracket = errors.New("missing closing bracket for IPv6 address") )
Host parsing errors
Functions ¶
func ParseHostsFile ¶ added in v0.0.10
ParseHostsFile reads a YAML hosts file and parses it into a map of role to hosts. The YAML format is: <role>: ["user:pass@host:port", ...]
func ToUnixPath ¶ added in v0.0.9
Types ¶
type Host ¶ added in v0.0.9
Host represents a remote server connection with authentication details.
func ParseHostLine ¶ added in v0.0.10
ParseHostLine parses a host connection string in the format "<user>:<password>@<address>:<port>". Supports IPv6 addresses in brackets, e.g., "user:pass@[::1]:22". Defaults port to 22 if not specified.
type HostPool ¶ added in v0.0.9
type HostPool struct {
// contains filtered or unexported fields
}
HostPool manages a cache of Remote connections keyed by Host. It reuses existing connections to avoid redundant SSH/SFTP handshakes.
func NewHostPool ¶ added in v0.0.9
func NewHostPool() *HostPool
NewHostPool creates a new empty HostPool.
type Remote ¶
type Remote struct {
Hostname string
Port int
Username string
Password string
Logger zerolog.Logger
// contains filtered or unexported fields
}
Remote represents a SSH/SFTP client for remote server operations
func (*Remote) ExecuteCommand ¶
ExecuteCommand executes a command on the remote host via SSH.
func (*Remote) UploadDir ¶ added in v0.0.10
UploadDir uploads a local directory recursively to remote path with better error handling
func (*Remote) UploadFile ¶
UploadFile uploads a local file to remote path with buffer optimization