Documentation
¶
Overview ¶
Package sshcommand provides functionality to build ssh command accompanied by options, which are taken from the user input or from the ssh_config file.
Index ¶
- func BaseCMD() string
- func ConnectCommand(options ...Option) string
- func CopyIDCommand(options ...Option) string
- func LoadConfigCommand(options ...Option) string
- type Option
- type OptionAddress
- type OptionConfigFilePath
- type OptionLoginName
- type OptionPrivateKey
- type OptionReadHostConfig
- type OptionRemotePort
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectCommand ¶
ConnectCommand - builds ssh command to connect to a remote host.
func CopyIDCommand ¶
CopyIDCommand - builds ssh command to copy ssh key to a remote host.
func LoadConfigCommand ¶
LoadConfigCommand - builds ssh command to load config from ssh_config file.
Types ¶
type OptionAddress ¶
type OptionAddress struct{ Value string }
OptionAddress - is a remote host address. Example: somehost.com.
type OptionConfigFilePath ¶
type OptionConfigFilePath struct{ Value string }
OptionConfigFilePath - is a path to ssh_config file.
type OptionLoginName ¶
type OptionLoginName struct{ Value string }
OptionLoginName - is a login name which is used when connecting to a remote host. Ex: loginname@somehost.com.
type OptionPrivateKey ¶
type OptionPrivateKey struct{ Value string }
OptionPrivateKey - ssh private key path in file system.
type OptionReadHostConfig ¶
type OptionReadHostConfig struct{ Value string }
OptionReadHostConfig - is used to read host config from ssh_config.
type OptionRemotePort ¶
type OptionRemotePort struct{ Value string }
OptionRemotePort - Remote port to connect to.