Documentation
¶
Overview ¶
Package exec is the single seam to external commands (orb, docker, scion, iptables). Real execution uses os/exec; tests inject FakeRunner so backend logic is verifiable offline. Mirrors the Ruby ScionClient runner pattern.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeRunner ¶
type FakeRunner struct {
Calls []Call
// contains filtered or unexported fields
}
func NewFakeRunner ¶
func NewFakeRunner() *FakeRunner
func (*FakeRunner) Script ¶
func (f *FakeRunner) Script(key string, res Result)
Script registers a canned Result for a "name arg0 arg1 ..." prefix key.
type Runner ¶
type Runner interface {
// Run executes name+args with optional extra env (KEY=VALUE merged over the
// process env). A non-zero exit returns a non-nil error AND the Result.
Run(ctx context.Context, env map[string]string, name string, args ...string) (Result, error)
// RunIn is like Run but executes in the given working directory. An empty dir
// uses the process cwd.
RunIn(ctx context.Context, dir string, env map[string]string, name string, args ...string) (Result, error)
}
Click to show internal directories.
Click to hide internal directories.