Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect() error
- func (c *Client) CopyDirectory(localPath, remotePath string) error
- func (c *Client) CopyFile(localPath, remotePath string) error
- func (c *Client) CopyFileWithMode(localPath, remotePath string, mode os.FileMode) error
- func (c *Client) CopyFromRemote(remotePath, localPath string) error
- func (c *Client) Execute(cmd string) (string, error)
- func (c *Client) ExecuteStream(cmd string, stdout, stderr io.Writer) error
- func (c *Client) ExecuteWithContext(ctx context.Context, cmd string) (string, error)
- func (c *Client) IsConnected() bool
- func (c *Client) StartStream(cmd string) (*StreamingSession, error)
- func (c *Client) UploadReader(reader io.Reader, remotePath string, mode os.FileMode) error
- type MultiplexConfig
- type Multiplexer
- type MuxConnection
- type Pool
- type StreamingSession
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps an SSH connection with additional functionality
func (*Client) Connect ¶
Connect establishes the SSH connection with retry logic and optimized TCP settings
func (*Client) CopyDirectory ¶
CopyDirectory copies a directory from local to remote server
func (*Client) CopyFileWithMode ¶
CopyFileWithMode uploads a file to the remote server with specific permissions
func (*Client) CopyFromRemote ¶
CopyFromRemote copies a file from remote to local
func (*Client) ExecuteStream ¶
ExecuteStream runs a command and streams output in real-time
func (*Client) ExecuteWithContext ¶
ExecuteWithContext runs a command with context support for cancellation
func (*Client) IsConnected ¶
IsConnected checks if the client is connected
func (*Client) StartStream ¶
func (c *Client) StartStream(cmd string) (*StreamingSession, error)
StartStream creates a new streaming session for long-running commands
type MultiplexConfig ¶
MultiplexConfig holds multiplexing configuration
type Multiplexer ¶
type Multiplexer struct {
// contains filtered or unexported fields
}
Multiplexer manages SSH connection multiplexing for improved performance
func NewMultiplexer ¶
func NewMultiplexer() *Multiplexer
NewMultiplexer creates a new SSH multiplexer
func (*Multiplexer) CloseAll ¶
func (m *Multiplexer) CloseAll()
CloseAll closes all multiplexed connections
func (*Multiplexer) GetConnection ¶
func (m *Multiplexer) GetConnection(host string, port int, user string, sshKey string) (*MuxConnection, error)
GetConnection retrieves or creates a multiplexed connection
type MuxConnection ¶
type MuxConnection struct {
// contains filtered or unexported fields
}
MuxConnection represents a multiplexed SSH connection
func (*MuxConnection) Close ¶
func (c *MuxConnection) Close() error
Close closes the multiplexed connection
func (*MuxConnection) Execute ¶
func (c *MuxConnection) Execute(command string) (string, error)
Execute runs a command using the multiplexed connection
func (*MuxConnection) IsHealthy ¶
func (c *MuxConnection) IsHealthy() bool
IsHealthy checks if the multiplexed connection is still active
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool manages a pool of SSH connections
func (*Pool) GetOrCreate ¶
GetOrCreate gets an existing client from the pool or creates a new one
type StreamingSession ¶
type StreamingSession struct {
Stdout io.Reader
Stderr io.Reader
// contains filtered or unexported fields
}
StreamingSession represents a streaming SSH session
func (*StreamingSession) Close ¶
func (s *StreamingSession) Close() error
Close closes the streaming session