Documentation
¶
Index ¶
- type ConfigParser
- type Connection
- type ConnectionManager
- func (cm *ConnectionManager) Connect(host string) error
- func (cm *ConnectionManager) Disconnect(host string) error
- func (cm *ConnectionManager) Execute(host, command string) (string, string, error)
- func (cm *ConnectionManager) GetActiveConnections() []string
- func (cm *ConnectionManager) SetConfigs(configs map[string]*SSHConfig)
- type SSHConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigParser ¶
type ConfigParser struct {
// contains filtered or unexported fields
}
ConfigParser parses SSH config files
func NewConfigParser ¶
func NewConfigParser() *ConfigParser
NewConfigParser creates a new SSH config parser
func (*ConfigParser) GetAllConfigs ¶
func (p *ConfigParser) GetAllConfigs() map[string]*SSHConfig
GetAllConfigs returns all parsed SSH configurations
func (*ConfigParser) GetConfig ¶
func (p *ConfigParser) GetConfig(host string) (*SSHConfig, bool)
GetConfig returns SSH configuration for a specific host
func (*ConfigParser) ParseConfigFiles ¶
func (p *ConfigParser) ParseConfigFiles() error
ParseConfigFiles parses ~/.ssh/config and ~/.ssh/config.d/*.conf
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents an SSH connection
type ConnectionManager ¶
type ConnectionManager struct {
// contains filtered or unexported fields
}
ConnectionManager manages SSH connections
func NewConnectionManager ¶
func NewConnectionManager() *ConnectionManager
NewConnectionManager creates a new connection manager
func (*ConnectionManager) Connect ¶
func (cm *ConnectionManager) Connect(host string) error
Connect connects to a host using SSH
func (*ConnectionManager) Disconnect ¶
func (cm *ConnectionManager) Disconnect(host string) error
Disconnect disconnects from a host
func (*ConnectionManager) Execute ¶
func (cm *ConnectionManager) Execute(host, command string) (string, string, error)
Execute executes a command on the remote host
func (*ConnectionManager) GetActiveConnections ¶
func (cm *ConnectionManager) GetActiveConnections() []string
GetActiveConnections returns the list of active connections
func (*ConnectionManager) SetConfigs ¶
func (cm *ConnectionManager) SetConfigs(configs map[string]*SSHConfig)
SetConfigs sets the SSH configurations
Click to show internal directories.
Click to hide internal directories.