ssh

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func (Connection) Run

func (c Connection) Run(cmd string) (stdout, stderr []byte, exitCode int, err error)

func (Connection) Stream

func (c Connection) Stream(cmd string, stdoutWriter io.Writer) (stderr []byte, exitCode int, err error)

func (Connection) StreamStdin

func (c Connection) StreamStdin(cmd string, stdinReader io.Reader) (stdout, stderr []byte, exitCode int, err error)

func (Connection) Username

func (c Connection) Username() string

type Logger

type Logger interface {
	Warn(tag, msg string, args ...interface{})
	Debug(tag, msg string, args ...interface{})
}

type RemoteRunner added in v1.1.4

type RemoteRunner interface {
	ConnectedUsername() string
	DirectoryExists(dir string) (bool, error)
	RemoveDirectory(dir string) error
	ArchiveAndDownload(directory string, writer io.Writer) error
	CreateDirectory(directory string) error
	ExtractAndUpload(reader io.Reader, directory string) error
	SizeOf(path string) (string, error)
	ChecksumDirectory(path string) (map[string]string, error)
	RunScript(path, label string) (string, error)
	RunScriptWithEnv(path string, env map[string]string, label string) (string, error)
	FindFiles(pattern string) ([]string, error)
}

func NewSshRemoteRunner added in v1.1.4

func NewSshRemoteRunner(host, user, privateKey string, publicKeyCallback ssh.HostKeyCallback, publicKeyAlgorithm []string, logger Logger) (RemoteRunner, error)

type RemoteRunnerFactory added in v1.1.4

type RemoteRunnerFactory func(host, user, privateKey string, publicKeyCallback ssh.HostKeyCallback, publicKeyAlgorithm []string, logger Logger) (RemoteRunner, error)

type SSHConnection

type SSHConnection interface {
	Stream(cmd string, writer io.Writer) ([]byte, int, error)
	StreamStdin(cmd string, reader io.Reader) ([]byte, []byte, int, error)
	Run(cmd string) ([]byte, []byte, int, error)
	Username() string
}

func NewConnection

func NewConnection(hostName, userName, privateKey string, publicKeyCallback ssh.HostKeyCallback, publicKeyAlgorithm []string, logger Logger) (SSHConnection, error)

func NewConnectionWithServerAliveInterval

func NewConnectionWithServerAliveInterval(hostName, userName, privateKey string, publicKeyCallback ssh.HostKeyCallback, publicKeyAlgorithm []string, serverAliveInterval time.Duration, logger Logger) (SSHConnection, error)

type SSHOptsGenerator

type SSHOptsGenerator func(uuidGen uuid.Generator) (director.SSHOpts, string, error)

type SshRemoteRunner added in v1.1.4

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

func (SshRemoteRunner) ArchiveAndDownload added in v1.1.4

func (r SshRemoteRunner) ArchiveAndDownload(directory string, writer io.Writer) error

func (SshRemoteRunner) ChecksumDirectory added in v1.1.4

func (r SshRemoteRunner) ChecksumDirectory(path string) (map[string]string, error)

func (SshRemoteRunner) ConnectedUsername added in v1.1.4

func (r SshRemoteRunner) ConnectedUsername() string

func (SshRemoteRunner) CreateDirectory added in v1.1.4

func (r SshRemoteRunner) CreateDirectory(directory string) error

func (SshRemoteRunner) DirectoryExists added in v1.1.4

func (r SshRemoteRunner) DirectoryExists(dir string) (bool, error)

func (SshRemoteRunner) ExtractAndUpload added in v1.1.4

func (r SshRemoteRunner) ExtractAndUpload(reader io.Reader, directory string) error

func (SshRemoteRunner) FindFiles added in v1.1.4

func (r SshRemoteRunner) FindFiles(pattern string) ([]string, error)

func (SshRemoteRunner) RemoveDirectory added in v1.1.4

func (r SshRemoteRunner) RemoveDirectory(dir string) error

func (SshRemoteRunner) RunScript added in v1.1.4

func (r SshRemoteRunner) RunScript(path, label string) (string, error)

func (SshRemoteRunner) RunScriptWithEnv added in v1.1.4

func (r SshRemoteRunner) RunScriptWithEnv(path string, env map[string]string, label string) (string, error)

func (SshRemoteRunner) SizeOf added in v1.1.4

func (r SshRemoteRunner) SizeOf(path string) (string, error)

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