command

package
v0.1.54 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInterface

type ClientInterface interface {
	NewSession() (SSHSession, error)
}

ClientInterface -

type DefaultRemoteExecutor

type DefaultRemoteExecutor struct {
	Client         ClientInterface
	LazyClientDial func()
	// contains filtered or unexported fields
}

DefaultRemoteExecutor -

func (*DefaultRemoteExecutor) Execute

func (executor *DefaultRemoteExecutor) Execute(dest io.Writer, command string) (err error)

Execute - Copy the output from a command to the specified io.Writer

type Executer

type Executer interface {
	Execute(destination io.Writer, command string) error
}

Executer -

func NewLocalExecuter

func NewLocalExecuter() Executer

NewLocalExecuter -

func NewRemoteExecutor

func NewRemoteExecutor(sshCfg SshConfig) (executor Executer, err error)

NewRemoteExecutor - This method creates executor based on ssh, it has concrete ssh reference

type SSHSession

type SSHSession interface {
	Start(cmd string) error
	Wait() error
	StdoutPipe() (io.Reader, error)
	Close() error
}

SSHSession -

type SshClientWrapper

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

SshClientWrapper - of ssh client to match client interface signature, since client.NewSession() does not use an interface

func NewClientWrapper

func NewClientWrapper(client *ssh.Client) *SshClientWrapper

NewClientWrapper -

func (*SshClientWrapper) NewSession

func (c *SshClientWrapper) NewSession() (SSHSession, error)

NewSession -

type SshConfig

type SshConfig struct {
	Username string
	Password string
	Host     string
	Port     int
	SSLKey   string
}

SshConfig - for the SSH connection

func (*SshConfig) GetAuthMethod added in v0.1.30

func (s *SshConfig) GetAuthMethod() (authMethod []ssh.AuthMethod)

GetAuthMethod -

Jump to

Keyboard shortcuts

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