sshclient

package
v0.0.0-...-0391a7e Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command string
	Env     []string
	Stdin   io.Reader
	Stdout  io.Writer
	Stderr  io.Writer
}

Command holds the input and output data for a command

type CommandOutput

type CommandOutput struct {
	Stdin  string
	Stdout string
	Stderr string
}

CommandOutput is the buffer contents of a completed command

type SSHClient

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

SSHClient forms the external type

func NewSSHClient

func NewSSHClient(username string, password string, hostname string) *SSHClient

NewSSHClient simple constructor

func (*SSHClient) Command

func (s *SSHClient) Command(cmdString string) (*CommandOutput, error)

Command takes string and inputs to stdin

func (*SSHClient) Execute

func (s *SSHClient) Execute(cmd *Command) (*Command, error)

Execute runs an SSH command and returns a struct of stdin, stdout and stderr

func (*SSHClient) Quit

func (s *SSHClient) Quit()

Quit closes the connection

type ShellConnection

type ShellConnection interface {
	Execute(*Command) (*Command, error)
	Command(string) (*CommandOutput, error)
}

ShellConnection represents local, remote or fake unix shell interactions

Jump to

Keyboard shortcuts

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