host

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 4 Imported by: 0

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) Clone

func (h *Host) Clone() Host

Clone host model.

func (*Host) CmdSSHConfig

func (h *Host) CmdSSHConfig() string

CmdSSHConfig - returns SSH command for loading host default configuration.

func (*Host) CmdSSHConnect

func (h *Host) CmdSSHConnect() string

CmdSSHConnect - returns SSH command for connecting to a remote host.

func (*Host) CmdSSHCopyID added in v1.2.0

func (h *Host) CmdSSHCopyID() string

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

func (h *Host) IsReadOnly() bool

IsReadOnly - returns true if host storage does not support modification.

func (*Host) IsUserDefinedSSHCommand

func (h *Host) IsUserDefinedSSHCommand() bool

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.

Jump to

Keyboard shortcuts

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