driver

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	Execute(args ...string) (string, error)
	ExecuteComplex(args []string, opts ExecuteOpts) (string, error)
	IsMissingVMErr(output string) bool
}

type ExecDriver

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

func NewExecDriver

func NewExecDriver(runner Runner, retrier Retrier, binPath string, logger boshlog.Logger) ExecDriver

func (ExecDriver) Execute

func (d ExecDriver) Execute(args ...string) (string, error)

func (ExecDriver) ExecuteComplex

func (d ExecDriver) ExecuteComplex(args []string, opts ExecuteOpts) (string, error)

func (ExecDriver) IsMissingVMErr added in v0.0.4

func (d ExecDriver) IsMissingVMErr(output string) bool

type ExecuteOpts

type ExecuteOpts struct {
	IgnoreNonZeroExitStatus bool
}

type ExpandingPathRunner added in v0.0.4

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

func NewExpandingPathRunner added in v0.0.4

func NewExpandingPathRunner(other RawRunner) *ExpandingPathRunner

func (*ExpandingPathRunner) Execute added in v0.0.4

func (r *ExpandingPathRunner) Execute(path string, args ...string) (string, int, error)

func (*ExpandingPathRunner) Get added in v0.0.4

func (r *ExpandingPathRunner) Get(path string) ([]byte, error)

func (*ExpandingPathRunner) Put added in v0.0.4

func (r *ExpandingPathRunner) Put(path string, contents []byte) error

func (*ExpandingPathRunner) Upload added in v0.0.4

func (r *ExpandingPathRunner) Upload(srcPath, dstPath string) error

type LocalRunner

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

func NewLocalRunner

func NewLocalRunner(fs boshsys.FileSystem, cmdRunner boshsys.CmdRunner, logger boshlog.Logger) LocalRunner

func (LocalRunner) Execute

func (r LocalRunner) Execute(path string, args ...string) (string, int, error)

func (LocalRunner) Get

func (r LocalRunner) Get(path string) ([]byte, error)

func (LocalRunner) HomeDir added in v0.0.4

func (r LocalRunner) HomeDir() (string, error)

func (LocalRunner) Put

func (r LocalRunner) Put(path string, contents []byte) error

func (LocalRunner) Upload

func (r LocalRunner) Upload(srcPath, dstPath string) error

type RawRunner added in v0.0.4

type RawRunner interface {
	HomeDir() (string, error)
	Runner
}

type Retrier

type Retrier interface {
	Retry(func() error) error
	RetryComplex(func() error, int, time.Duration) error
}

type RetrierImpl

type RetrierImpl struct{}

func (RetrierImpl) Retry

func (r RetrierImpl) Retry(actionFunc func() error) error

func (RetrierImpl) RetryComplex

func (RetrierImpl) RetryComplex(actionFunc func() error, times int, sleep time.Duration) error

type RetryableError

type RetryableError interface {
	Retryable()
}

type RetryableErrorImpl

type RetryableErrorImpl struct {
	Err error
}

func (RetryableErrorImpl) Error

func (e RetryableErrorImpl) Error() string

func (RetryableErrorImpl) Retryable

func (RetryableErrorImpl) Retryable()

type Runner

type Runner interface {
	Execute(path string, args ...string) (string, int, error)
	Upload(srcDir, dstDir string) error
	Put(path string, contents []byte) error
	Get(path string) ([]byte, error)
}

type SSHRunner added in v0.0.4

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

func NewSSHRunner added in v0.0.4

func NewSSHRunner(opts SSHRunnerOpts, fs boshsys.FileSystem, logger boshlog.Logger) *SSHRunner

func (*SSHRunner) Execute added in v0.0.4

func (r *SSHRunner) Execute(path string, args ...string) (string, int, error)

func (*SSHRunner) Get added in v0.0.4

func (r *SSHRunner) Get(path string) ([]byte, error)

func (*SSHRunner) HomeDir added in v0.0.4

func (r *SSHRunner) HomeDir() (string, error)

func (*SSHRunner) Put added in v0.0.4

func (r *SSHRunner) Put(path string, contents []byte) error

func (*SSHRunner) Upload added in v0.0.4

func (r *SSHRunner) Upload(srcPath, dstPath string) error

type SSHRunnerOpts added in v0.0.4

type SSHRunnerOpts struct {
	Host       string
	Username   string
	PrivateKey string
}

Jump to

Keyboard shortcuts

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