{"modulePath":"github.com/stacklok/mecatl","version":"v0.0.52","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package memexecutor\n\nPackage memexecutor is a test-only executor over memfs and scripted commands.\n\n## Variables\n\n```go\nvar ErrUnknownCommand = errors.New(\"memexecutor: no script for command\")\n```\nErrUnknownCommand reports a command with no script.\n\n## Functions\n\n```go\nfunc Dial(t testing.TB, e Executor) *grpc.ClientConn\n```\nDial serves e in process for the test's lifetime.\n\n## Types\n\n```go\ntype Executor struct {\n\tFiles          *memfs.Workspace\n\tFileOptions    []fileserver.Option\n\tCommands       *Runner\n\tCommandOptions []commandserver.Option\n}\n```\nExecutor configures Dial; a nil service stays unregistered.\n\n```go\ntype Runner struct {\n\t// contains filtered or unexported fields\n}\n```\nRunner is a scripted commandserver.Runner.\n\n```go\nfunc NewRunner() *Runner\n```\nNewRunner returns an empty Runner.\n\n```go\nfunc (r *Runner) Refuse(command string, err error)\n```\nRefuse fails every start of command with err.\n\n```go\nfunc (r *Runner) Running() int\n```\nRunning counts unfinished scripts.\n\n```go\nfunc (r *Runner) Script(command string, s Script)\n```\nScript plays s for command.\n\n```go\nfunc (r *Runner) Start(\n\tctx context.Context,\n\tcommand string,\n\tstdout io.Writer,\n\tstderr io.Writer,\n) (commandserver.Process, error)\n```\nStart implements commandserver.Runner.\n\n```go\ntype Script func(ctx context.Context, stdout, stderr io.Writer) commandserver.Exit\n```\nScript plays a command until it returns.\n\n```go\nfunc Block(ready string) Script\n```\nBlock writes ready to stdout, then waits for ctx.\n\n```go\nfunc Exit(stdout, stderr string, code int) Script\n```\nExit writes stdout and stderr, then exits with code.\n\n```go\nfunc OutcomeUnknown(s Script) Script\n```\nOutcomeUnknown plays s without confirming cleanup.\n\n```go\nfunc Stream(next \u003c-chan struct{}, chunks ...string) Script\n```\nStream writes one chunk to stdout per receive from next, then exits 0.\n\n","path":"github.com/stacklok/mecatl/internal/executorrpc/memexecutor","name":"memexecutor","synopsis":"Package memexecutor is a test-only executor over memfs and scripted commands.","isRedistributable":true}
