rexec

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCommandOnInstance

func ExecCommandOnInstance(sshConfig *SshConfigDef, ipAddress string, cmd string, isVerbose bool) (l.LogMsg, error)

func ExecEmbeddedScriptsOnInstance

func ExecEmbeddedScriptsOnInstance(sshConfig *SshConfigDef, ipAddress string, embeddedScriptPaths []string, envVars map[string]string, isVerbose bool) (l.LogMsg, error)

func ExecSshForClient

func ExecSshForClient(sshClient *ssh.Client, cmd string) (string, string, error)

Used for file transfer

func HarvestAllEmbeddedFilesPaths

func HarvestAllEmbeddedFilesPaths(curDirPath string, harvestedPathsMap map[string]bool) error

func NewSshClientConfig

func NewSshClientConfig(user string, privateKeyOrPath string) (*ssh.ClientConfig, error)

Types

type ExecResult

type ExecResult struct {
	Cmd     string
	Stdout  string
	Stderr  string
	Elapsed float64
	Error   error
}

func ExecSsh

func ExecSsh(sshConfig *SshConfigDef, ipAddress string, cmd string, envVars map[string]string) ExecResult

func ExecSshAndReturnLastLine

func ExecSshAndReturnLastLine(sshConfig *SshConfigDef, ipAddress string, cmd string) (string, ExecResult)

Used on volume attachment

func (*ExecResult) ToString

func (er *ExecResult) ToString() string

type SshConfigDef

type SshConfigDef struct {
	BastionExternalIpAddressName string `json:"bastion_external_ip_address_name"`
	BastionExternalIp            string `json:"bastion_external_ip_address"` // Output only
	Port                         int    `json:"port"`
	User                         string `json:"user"`
	PrivateKeyOrPath             string `json:"private_key_or_path"`
}

type TunneledSshClient

type TunneledSshClient struct {
	ProxySshClient  *ssh.Client
	TunneledTcpConn net.Conn
	TunneledSshConn ssh.Conn
	SshClient       *ssh.Client
}

func NewTunneledSshClient

func NewTunneledSshClient(sshConfig *SshConfigDef, ipAddress string) (*TunneledSshClient, error)

Our jumphost implementation

func (*TunneledSshClient) Close

func (tsc *TunneledSshClient) Close()

Jump to

Keyboard shortcuts

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