Documentation
¶
Index ¶
Constants ¶
const ( TypeConnect = "tcp" Timeout = 20 * time.Second DisableEcho = 0 IgnoreCR = 1 TypeTerm = "vt100" HeightTerminal = 80 WidthTerminal = 40 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connect ¶ added in v2.3.0
type Connect struct { // Alias is a user-defined name for the connection Alias string `json:"alias"` Login string `json:"login"` Address string `json:"address"` Password string `json:"password"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` // Type specifies the connection protocol (e.g., "ssh") Type ConnectionType `json:"type"` // SshOptions contains SSH-specific configuration options SshOptions *SshOptions `json:"ssh_options,omitempty"` }
Connect represents a single connection configuration
type ConnectionType ¶ added in v2.3.0
type ConnectionType string
const TypeSSH ConnectionType = "ssh"
TypeSSH type for ssh connection
type Connections ¶ added in v2.3.0
type Connections struct {
Connects []Connect `json:"connects"`
}
type Ssh ¶
type Ssh struct{}
func NewSshConnector ¶ added in v2.3.0
func NewSshConnector() *Ssh
func (*Ssh) Connect ¶ added in v2.3.0
Connect starts an interactive shell session using the established SSH connection. It manages the session lifecycle including proper cleanup on exit. Returns error if shell startup or session wait fails.
func (*Ssh) NewSession ¶ added in v2.3.0
NewSession establishes a new SSH session with the remote server. It handles the complete connection lifecycle including: - Authentication (password or private key) - Client creation - Terminal setup - Error handling and resource cleanup Returns an active SSH session or error if any step fails.
type SshOptions ¶ added in v2.3.0
type SshOptions struct { // Port specifies the SSH port (default is 22 if not specified) Port int `json:"port"` // PrivateKey contains the PEM-encoded private key for authentication PrivateKey string `json:"private_key"` }
SshOptions contains configuration options specific to SSH connections