ssh

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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

type SSHConfig

type SSHConfig struct {
	Host         string
	HostName     string
	Port         string
	User         string
	IdentityFile string
	ProxyJump    string
}

SSHConfig represents SSH configuration for a host

Jump to

Keyboard shortcuts

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