Documentation
¶
Index ¶
Constants ¶
const UseSimExecerArg = "#! sim execer"
A placeholder string that indicates a command should be run on SimExecer
Variables ¶
This section is empty.
Functions ¶
func MakeSimExecerInterceptor ¶
Create an InterceptExecer that will send cmd's to simExecer or delegate
func StartsWithSimExecer ¶
Returns whether cmd's first arg starts with UseSimExecerArg
Types ¶
type DoneExecer ¶
type DoneExecer struct {
State execer.ProcessState
ExitCode errors.ExitCode
ExecError error
}
doneExecer finishes something as soon as its run
func (*DoneExecer) Abort ¶
func (e *DoneExecer) Abort() execer.ProcessStatus
func (*DoneExecer) Wait ¶
func (e *DoneExecer) Wait() execer.ProcessStatus
type InterceptExecer ¶
type InterceptExecer struct {
Condition func(execer.Command) bool
Interceptor execer.Execer
Default execer.Execer
}
InterceptExecer is a Composite Execer. For each command c, if Condition(c), InterceptExecer delegates to Interceptor, otherwise Default
type SimExecer ¶
type SimExecer struct {
// contains filtered or unexported fields
}
func NewSimExecer ¶
func NewSimExecer() *SimExecer
func (*SimExecer) Exec ¶
SimExecer execs by simulating running argv. each arg in command.argv is simulated in order. valid args are: complete <exitcode int>
complete with exitcode
pause
pause until SimExecer.Resume() is called
sleep <millis int>
sleep for millis milliseconds
stdout <message>
put <message> in stdout in the response
stderr <message>
put <message> in stderr in the response
NB: SimExecer is often hid behind an InterceptExecer, so you should pass argv[0] as "#! sim execer" (Cf. intercept.go)