ssh

package
v0.0.0-...-d952d6d Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2023 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandOperator

type CommandOperator interface {
	Execute(command string) (CommandRes, error)
	ExecuteStdio(command string, stream bool) (CommandRes, error)
}

CommandOperator executes a command on a machine to install k3sup

type CommandRes

type CommandRes struct {
	StdOut   []byte
	StdErr   []byte
	ExitCode int
}

CommandRes contains the STDIO output from running a command

type ExecOperator

type ExecOperator struct {
}

ExecOperator executes commands on the local machine directly

func (ExecOperator) Execute

func (ex ExecOperator) Execute(command string) (CommandRes, error)

func (ExecOperator) ExecuteStdio

func (ex ExecOperator) ExecuteStdio(command string, stream bool) (CommandRes, error)

type SSHOperator

type SSHOperator struct {
	// contains filtered or unexported fields
}

SSHOperator executes commands on a remote machine over an SSH session

func NewSSHOperator

func NewSSHOperator(address string, config *ssh.ClientConfig) (*SSHOperator, error)

func (SSHOperator) Close

func (s SSHOperator) Close() error

func (SSHOperator) Execute

func (s SSHOperator) Execute(command string) (CommandRes, error)

func (SSHOperator) ExecuteStdio

func (s SSHOperator) ExecuteStdio(command string, stream bool) (CommandRes, error)

Jump to

Keyboard shortcuts

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