launcher

package
v0.0.0-...-394a7f2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TerminalTerm  = "xterm"
	SSHKeyKeyword = "SSH-KEY"
)

Variables

This section is empty.

Functions

func GetConfigFromSshConnector

func GetConfigFromSshConnector(tgt *SshConnector) *config.ServerListConfig

GetConfigFromSshConnector Get ServerListConfig by SshConnector

Types

type Connector

type Connector interface {
	Launch() bool
	CreateConnection() (sshClient *ssh.Client, err error)
	CloseConnection(sshClient *ssh.Client)
	TryToConnect() (err error)
}

type ScpLauncher

type ScpLauncher struct {
	SshConnector
	Src       string
	Dest      string
	Recursive bool
}

func NewScpLaunchersByCombinations

func NewScpLaunchersByCombinations(combinations chan []interface{}, src string, dest string,
	recursive bool, sshTimeout time.Duration) (launchers []*ScpLauncher)

func (*ScpLauncher) Launch

func (c *ScpLauncher) Launch() bool

type SshConnector

type SshConnector struct {
	Ip         string
	Port       string
	User       string
	Password   string
	Key        string
	SshTimeout time.Duration
}

func GetSshConnectorFromConfig

func GetSshConnectorFromConfig(conf *config.ServerListConfig) *SshConnector

GetSshConnectorFromConfig Get SshConnector by ServerListConfig

func (*SshConnector) CloseConnection

func (sc *SshConnector) CloseConnection(sshClient *ssh.Client)

func (*SshConnector) CreateConnection

func (sc *SshConnector) CreateConnection() (sshClient *ssh.Client, err error)

func (*SshConnector) Launch

func (sc *SshConnector) Launch() bool

func (*SshConnector) LoadConfig

func (sc *SshConnector) LoadConfig() (config *ssh.ClientConfig)

func (*SshConnector) TryToConnect

func (sc *SshConnector) TryToConnect() (err error)

type SshLauncher

type SshLauncher struct {
	SshConnector
}

func NewSshLaunchersByCombinations

func NewSshLaunchersByCombinations(combinations chan []interface{},
	sshTimeout time.Duration) (launchers []*SshLauncher)

func (*SshLauncher) Launch

func (h *SshLauncher) Launch() bool

Jump to

Keyboard shortcuts

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