|
|
|
@ -58,6 +58,11 @@ type apiPrimitive struct {
@@ -58,6 +58,11 @@ type apiPrimitive struct {
|
|
|
|
|
die chan bool |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// SetOptions sets the primitve's options
|
|
|
|
|
func (a *apiPrimitive) SetOptions(arg RunOptions) { |
|
|
|
|
a.opts = arg |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Stop halts the subprocess
|
|
|
|
|
func (a *apiPrimitive) Stop() { |
|
|
|
|
a.cmd.Process.Kill() |
|
|
|
@ -195,3 +200,10 @@ func (a *API) Listen() (out chan string, err error) {
@@ -195,3 +200,10 @@ func (a *API) Listen() (out chan string, err error) {
|
|
|
|
|
out, err = a.reader.listen() |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func NewAPI(arg RunOptions) *API { |
|
|
|
|
var result API |
|
|
|
|
result.reader.SetOptions(arg) |
|
|
|
|
result.writer.SetOptions(arg) |
|
|
|
|
return &result |
|
|
|
|
} |
|
|
|
|