Files
weave-scope/common/exec/exec.go
Tom Wilkie d4e58b9e33 Decouple Scope lifecycle from Weave lifecycle
- Run the Weave integrations regardless of if weave is detected.
- Make everything backoff and not spam the logs.
- Add miekg dns to vendor.
- Have the app periodically register with weaveDNS, and the probe do lookups there.
- Decide what the local networks are at runtime, not once at startup.
- Correctly resolve app ids, fixes #825
2016-02-09 14:24:57 +00:00

31 lines
488 B
Go

package exec
import (
"io"
"os/exec"
)
// Cmd is a hook for mocking
type Cmd interface {
StdoutPipe() (io.ReadCloser, error)
StderrPipe() (io.ReadCloser, error)
Start() error
Wait() error
Kill() error
Output() ([]byte, error)
Run() error
}
// Command is a hook for mocking
var Command = func(name string, args ...string) Cmd {
return &realCmd{exec.Command(name, args...)}
}
type realCmd struct {
*exec.Cmd
}
func (c *realCmd) Kill() error {
return c.Cmd.Process.Kill()
}