Fixed the executor command

This commit is contained in:
Diptanu Choudhury
2016-02-02 14:36:11 -08:00
parent d0f53c8586
commit dbb3570d59
5 changed files with 52 additions and 6 deletions

View File

@@ -0,0 +1,32 @@
// +build !linux
package plugins
import (
"os/exec"
"time"
)
type BasicExecutor struct {
}
func NewExecutor() Executor {
return &BasicExecutor{}
}
func (e *BasicExecutor) LaunchCmd(cmd *exec.Cmd, ctx *ExecutorContext) (*ProcessState, error) {
return &ProcessState{Pid: 5, ExitCode: -1, Time: time.Now()}, nil
}
func (e *BasicExecutor) Wait() (*ProcessState, error) {
time.Sleep(5 * time.Second)
return &ProcessState{Pid: 0, ExitCode: 0, Time: time.Now()}, nil
}
func (e *BasicExecutor) Exit() (*ProcessState, error) {
return &ProcessState{Pid: 0, ExitCode: 0, Time: time.Now()}, nil
}
func (e *BasicExecutor) ShutDown() (*ProcessState, error) {
return &ProcessState{Pid: 0, ExitCode: 0, Time: time.Now()}, nil
}