ssh

package
v2.0.32 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Start() error
	Stop() error

	Dial(net, addr string) (net.Conn, error)
	Listen(net, addr string) (net.Listener, error)
}

type ClientConnectRetryStrategy

type ClientConnectRetryStrategy struct {
	ConnectionRefusedTimeout time.Duration
	AuthFailureTimeout       time.Duration
	TimeService              clock.Clock
	// contains filtered or unexported fields
}

func (*ClientConnectRetryStrategy) IsRetryable

func (s *ClientConnectRetryStrategy) IsRetryable(err error) bool

type ClientFactory

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

func NewClientFactory

func NewClientFactory(logger boshlog.Logger) ClientFactory

func (ClientFactory) New

func (f ClientFactory) New(opts ClientOpts) Client

type ClientImpl

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

func (*ClientImpl) Dial

func (s *ClientImpl) Dial(n, addr string) (net.Conn, error)

func (*ClientImpl) Listen

func (s *ClientImpl) Listen(n, addr string) (net.Listener, error)

func (*ClientImpl) Start

func (s *ClientImpl) Start() error

func (*ClientImpl) Stop

func (s *ClientImpl) Stop() error

type ClientOpts

type ClientOpts struct {
	Host string
	Port int

	User       string
	Password   string
	PrivateKey string

	DisableSOCKS bool
}

type ComboRunner

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

func NewComboRunner

func NewComboRunner(
	cmdRunner boshsys.CmdRunner,
	sessionFactory func(ConnectionOpts, boshdir.SSHResult) Session,
	signalNotifyFunc func(chan<- os.Signal, ...os.Signal),
	writer Writer,
	fs boshsys.FileSystem,
	ui boshui.UI,
	logger boshlog.Logger,
) ComboRunner

func (ComboRunner) Run

func (r ComboRunner) Run(connOpts ConnectionOpts, result boshdir.SSHResult, cmdFactory func(boshdir.Host) boshsys.Command) error

type ConnectionOpts

type ConnectionOpts struct {
	PrivateKey string

	GatewayDisable bool

	GatewayUsername       string
	GatewayHost           string
	GatewayPrivateKeyPath string

	SOCKS5Proxy string

	RawOpts []string
}

type InstanceWriter

type InstanceWriter interface {
	Stdout() io.Writer
	Stderr() io.Writer
	End(exitStatus int, err error)
}

type InteractiveRunner

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

func NewInteractiveRunner

func NewInteractiveRunner(comboRunner ComboRunner) InteractiveRunner

func (InteractiveRunner) Run

func (r InteractiveRunner) Run(connOpts ConnectionOpts, result boshdir.SSHResult, rawCmd []string) error

type NonInteractiveRunner

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

func NewNonInteractiveRunner

func NewNonInteractiveRunner(comboRunner ComboRunner) NonInteractiveRunner

func (NonInteractiveRunner) Run

func (r NonInteractiveRunner) Run(connOpts ConnectionOpts, result boshdir.SSHResult, rawCmd []string) error

type Provider

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

func NewProvider

func NewProvider(cmdRunner boshsys.CmdRunner, fs boshsys.FileSystem, ui boshui.UI, logger boshlog.Logger) Provider

func (Provider) NewResultsSSHRunner

func (p Provider) NewResultsSSHRunner(interactive bool) Runner

func (Provider) NewSCPRunner

func (p Provider) NewSCPRunner() SCPRunner

func (Provider) NewSSHRunner

func (p Provider) NewSSHRunner(interactive bool) Runner

type ResultsWriter

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

func NewResultsWriter

func NewResultsWriter(ui boshui.UI) *ResultsWriter

func (*ResultsWriter) Flush

func (w *ResultsWriter) Flush()

func (*ResultsWriter) ForInstance

func (w *ResultsWriter) ForInstance(jobName, indexOrID string) InstanceWriter

type Runner

type Runner interface {
	Run(ConnectionOpts, boshdir.SSHResult, []string) error
}

type SCPArgs

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

func NewSCPArgs

func NewSCPArgs(rawArgs []string, recursive bool) SCPArgs

func (SCPArgs) AllOrInstanceGroupOrInstanceSlug

func (a SCPArgs) AllOrInstanceGroupOrInstanceSlug() (boshdir.AllOrInstanceGroupOrInstanceSlug, error)

func (SCPArgs) ForHost

func (a SCPArgs) ForHost(host boshdir.Host) []string

type SCPRunner

type SCPRunner interface {
	Run(ConnectionOpts, boshdir.SSHResult, SCPArgs) error
}

type SCPRunnerImpl

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

func NewSCPRunner

func NewSCPRunner(comboRunner ComboRunner) SCPRunnerImpl

func (SCPRunnerImpl) Run

func (r SCPRunnerImpl) Run(connOpts ConnectionOpts, result boshdir.SSHResult, scpArgs SCPArgs) error

type Session

type Session interface {
	Start() ([]string, error)
	Finish() error
}

type SessionImpl

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

func NewSessionImpl

func NewSessionImpl(
	connOpts ConnectionOpts,
	sessOpts SessionImplOpts,
	result boshdir.SSHResult,
	fs boshsys.FileSystem,
) *SessionImpl

func (*SessionImpl) Finish

func (r *SessionImpl) Finish() error

func (*SessionImpl) Start

func (r *SessionImpl) Start() ([]string, error)

type SessionImplOpts

type SessionImplOpts struct {
	ForceTTY bool
}

type StreamingWriter

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

func NewStreamingWriter

func NewStreamingWriter(comboWriter *boshui.ComboWriter) *StreamingWriter

func (StreamingWriter) Flush

func (w StreamingWriter) Flush()

func (StreamingWriter) ForInstance

func (w StreamingWriter) ForInstance(jobName, indexOrID string) InstanceWriter

type Writer

type Writer interface {
	ForInstance(jobName, indexOrID string) InstanceWriter
	Flush()
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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