Documentation
¶
Overview ¶
Package host contains definition of Host data model.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Host ¶
type Host struct {
Address string `yaml:"address"`
Description string `yaml:"description,omitempty"`
Group string `yaml:"group,omitempty"`
ID int `yaml:"-"`
IdentityFilePath string `yaml:"identity_file_path,omitempty"`
LoginName string `yaml:"username,omitempty"`
RemotePort string `yaml:"network_port,omitempty"`
SSHHostConfig *sshconfig.Config `yaml:"-"`
StorageType constant.HostStorageEnum `yaml:"-"`
Title string `yaml:"title"`
}
Host model definition.
func NewHost ¶
func NewHost(id int, title, description, address, loginName, identityFilePath, remotePort string) Host
NewHost - constructs new Host model.
func (*Host) CmdSSHConfig ¶
CmdSSHConfig - returns SSH command for loading host default configuration.
func (*Host) CmdSSHConnect ¶
CmdSSHConnect - returns SSH command for connecting to a remote host.
func (*Host) CmdSSHCopyID ¶ added in v1.2.0
CmdSSHCopyID - returns SSH command for copying SSH key to a remote host (see ssh-copy-id). Be aware, that though ssh-copy-id respects ssh_config, it's impossible to specify alternative ssh config file when copy identity key.
func (*Host) IsReadOnly ¶ added in v1.4.0
IsReadOnly - returns true if host storage does not support modification.
func (*Host) IsUserDefinedSSHCommand ¶
IsUserDefinedSSHCommand returns true if the address contains spaces or "@" symbol, true means that user uses a custom config and not relying on LoginName, IdentityFilePath and RemotePort.