host

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 2 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 {
	ID               int         `yaml:"-"`
	Title            string      `yaml:"title"`
	Description      string      `yaml:"description,omitempty"`
	Group            string      `yaml:"group,omitempty"`
	Address          string      `yaml:"address"`
	RemotePort       string      `yaml:"network_port,omitempty"`
	LoginName        string      `yaml:"username,omitempty"`
	IdentityFilePath string      `yaml:"identity_file_path,omitempty"`
	SSHClientConfig  *ssh.Config `yaml:"-"`
}

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

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
JackTT - Gopher 🇻🇳