cmd

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2018 License: AGPL-3.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound                = errors.New("Executable file not found in $PATH")
	ErrTimeout                 = errors.New("Timeout")
	ErrKillProcessAfterTimeout = errors.New("Failed to kill process after timeout")
)
View Source
var (
	DefaultTimeout = 60 * time.Second
)

Functions

This section is empty.

Types

type Cmd

type Cmd interface {
	Run() (output string, err error)
}

Wrap os/exec/Cmd so we can test commands.

type CmdFactory

type CmdFactory interface {
	Make(name string, args ...string) Cmd
}
var Factory CmdFactory

Set in main/percona-agent/main.go to RealCmdFactory for real agent, else set in tests to mock.CmdFactory for testing.

type RealCmd

type RealCmd struct {
	Timeout time.Duration
	// contains filtered or unexported fields
}

func NewRealCmd

func NewRealCmd(name string, args ...string) *RealCmd

func (*RealCmd) Run

func (c *RealCmd) Run() (output string, err error)

type RealCmdFactory

type RealCmdFactory struct {
}

func (*RealCmdFactory) Make

func (f *RealCmdFactory) Make(name string, args ...string) Cmd

Jump to

Keyboard shortcuts

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