{"modulePath":"github.com/GoCodeAlone/go-plugin","version":"v1.7.0","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package cmdrunner\n\n## Variables\n\n```go\nvar (\n\n\t// ErrProcessNotFound is returned when a client is instantiated to\n\t// reattach to an existing process and it isn't found.\n\tErrProcessNotFound = errors.New(\"Reattachment process not found\")\n)\n```\n\n## Functions\n\n```go\nfunc ReattachFunc(pid int, addr net.Addr) runner.ReattachFunc\n```\nReattachFunc returns a function that allows reattaching to a plugin running as a plain process. The process may or may not be a child process.\n\n## Types\n\n```go\ntype CmdAttachedRunner struct {\n\t// contains filtered or unexported fields\n}\n```\nCmdAttachedRunner is mostly a subset of CmdRunner, except the Wait function does not assume the process is a child of the host process, and so uses a different implementation to wait on the process.\n\n```go\nfunc (*CmdAttachedRunner) HostToPlugin(hostNet, hostAddr string) (string, string, error)\n```\n\n```go\nfunc (c *CmdAttachedRunner) ID() string\n```\n\n```go\nfunc (c *CmdAttachedRunner) Kill(_ context.Context) error\n```\n\n```go\nfunc (*CmdAttachedRunner) PluginToHost(pluginNet, pluginAddr string) (string, string, error)\n```\n\n```go\nfunc (c *CmdAttachedRunner) Wait(_ context.Context) error\n```\n\n```go\ntype CmdRunner struct {\n\t// contains filtered or unexported fields\n}\n```\nCmdRunner implements the runner.Runner interface. It mostly just passes through to exec.Cmd methods.\n\n```go\nfunc NewCmdRunner(logger hclog.Logger, cmd *exec.Cmd) (*CmdRunner, error)\n```\nNewCmdRunner returns an implementation of runner.Runner for running a plugin as a subprocess. It must be passed a cmd that hasn't yet been started.\n\n```go\nfunc (c *CmdRunner) Diagnose(_ context.Context) string\n```\n\n```go\nfunc (*CmdRunner) HostToPlugin(hostNet, hostAddr string) (string, string, error)\n```\n\n```go\nfunc (c *CmdRunner) ID() string\n```\n\n```go\nfunc (c *CmdRunner) Kill(_ context.Context) error\n```\n\n```go\nfunc (c *CmdRunner) Name() string\n```\n\n```go\nfunc (*CmdRunner) PluginToHost(pluginNet, pluginAddr string) (string, string, error)\n```\n\n```go\nfunc (c *CmdRunner) Start(_ context.Context) error\n```\n\n```go\nfunc (c *CmdRunner) Stderr() io.ReadCloser\n```\n\n```go\nfunc (c *CmdRunner) Stdout() io.ReadCloser\n```\n\n```go\nfunc (c *CmdRunner) Wait(_ context.Context) error\n```\n\n","path":"github.com/GoCodeAlone/go-plugin/internal/cmdrunner","name":"cmdrunner","synopsis":"","isRedistributable":true}
