Versions in this module Expand all Collapse all v0 v0.1.0 Oct 20, 2019 Changes in this version + var DefaultErrorLog Logger = new(nopLogger) + var DefaultGracePeriod time.Duration = 30 * time.Second + var DefaultNewProcessFunc NewProcessFunc = NewOSProcess + var ErrNotStarted = errors.New("command not started") + var ErrUnimplemented = errors.New("unimplemented") + type Cmd struct + func Command(cmd string, args ...string) *Cmd + func CommandContext(ctx context.Context, cmd string, args ...string) *Cmd + func (c *Cmd) CombinedOutput() ([]byte, error) + func (c *Cmd) Output() ([]byte, error) + func (c *Cmd) Run() error + func (c *Cmd) Start() error + func (c *Cmd) Wait() error + type Config struct + ErrorLog Logger + GracePeriod time.Duration + NewProcessFunc NewProcessFunc + type Executor struct + Config *Config + func New(opts ...Option) *Executor + func (e *Executor) Command(cmd string, args ...string) *Cmd + func (e *Executor) CommandContext(ctx context.Context, cmd string, args ...string) *Cmd + type ExitStatus struct + Canceled bool + Code int + Err error + Killed bool + Signaled bool + Timeout bool + func (es *ExitStatus) Error() string + type FakeProcess struct + RunFunc func(ctx context.Context, cmd *exec.Cmd) error + func (p *FakeProcess) Kill() error + func (p *FakeProcess) Signal() os.Signal + func (p *FakeProcess) Start() error + func (p *FakeProcess) Terminate() error + func (p *FakeProcess) Wait() <-chan *ExitStatus + type Logger interface + Print func(...interface{}) + type NewProcessFunc func(*exec.Cmd) Process + func NewFakeNewProcessFunc(f func(ctx context.Context, cmd *exec.Cmd) error) NewProcessFunc + type Option func(*Config) + func WithErrorLog(l Logger) Option + func WithFakeProcess(f func(context.Context, *exec.Cmd) error) Option + func WithGracePeriod(d time.Duration) Option + func WithNewProcessFunc(f NewProcessFunc) Option + type Process interface + Kill func() error + Signal func() os.Signal + Start func() error + Terminate func() error + Wait func() <-chan *ExitStatus + func NewOSProcess(cmd *exec.Cmd) Process