package cmdrunner
import "github.com/hashicorp/go-plugin/internal/cmdrunner"
Index ¶
- Variables
- func ReattachFunc(pid int, addr net.Addr) runner.ReattachFunc
- type CmdAttachedRunner
- func (*CmdAttachedRunner) HostToPlugin(hostNet, hostAddr string) (string, string, error)
- func (c *CmdAttachedRunner) ID() string
- func (c *CmdAttachedRunner) Kill(_ context.Context) error
- func (*CmdAttachedRunner) PluginToHost(pluginNet, pluginAddr string) (string, string, error)
- func (c *CmdAttachedRunner) Wait(_ context.Context) error
- type CmdRunner
- func NewCmdRunner(logger hclog.Logger, cmd *exec.Cmd) (*CmdRunner, error)
- func (c *CmdRunner) Diagnose(_ context.Context) string
- func (*CmdRunner) HostToPlugin(hostNet, hostAddr string) (string, string, error)
- func (c *CmdRunner) ID() string
- func (c *CmdRunner) Kill(_ context.Context) error
- func (c *CmdRunner) Name() string
- func (*CmdRunner) PluginToHost(pluginNet, pluginAddr string) (string, string, error)
- func (c *CmdRunner) Start(_ context.Context) error
- func (c *CmdRunner) Stderr() io.ReadCloser
- func (c *CmdRunner) Stdout() io.ReadCloser
- func (c *CmdRunner) Wait(_ context.Context) error
Variables ¶
var ( // ErrProcessNotFound is returned when a client is instantiated to // reattach to an existing process and it isn't found. ErrProcessNotFound = errors.New("Reattachment process not found") )
Functions ¶
func ReattachFunc ¶
func ReattachFunc(pid int, addr net.Addr) runner.ReattachFunc
ReattachFunc returns a function that allows reattaching to a plugin running as a plain process. The process may or may not be a child process.
Types ¶
type CmdAttachedRunner ¶
type CmdAttachedRunner struct {
// contains filtered or unexported fields
}
CmdAttachedRunner 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.
func (*CmdAttachedRunner) HostToPlugin ¶
func (*CmdAttachedRunner) ID ¶
func (c *CmdAttachedRunner) ID() string
func (*CmdAttachedRunner) Kill ¶
func (c *CmdAttachedRunner) Kill(_ context.Context) error
func (*CmdAttachedRunner) PluginToHost ¶
func (*CmdAttachedRunner) Wait ¶
func (c *CmdAttachedRunner) Wait(_ context.Context) error
type CmdRunner ¶
type CmdRunner struct {
// contains filtered or unexported fields
}
CmdRunner implements the runner.Runner interface. It mostly just passes through to exec.Cmd methods.
func NewCmdRunner ¶
NewCmdRunner 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.
func (*CmdRunner) Diagnose ¶
func (*CmdRunner) HostToPlugin ¶
func (*CmdRunner) ID ¶
func (*CmdRunner) Kill ¶
func (*CmdRunner) Name ¶
func (*CmdRunner) PluginToHost ¶
func (*CmdRunner) Start ¶
func (*CmdRunner) Stderr ¶
func (c *CmdRunner) Stderr() io.ReadCloser
func (*CmdRunner) Stdout ¶
func (c *CmdRunner) Stdout() io.ReadCloser
func (*CmdRunner) Wait ¶
Source Files ¶
addr_translator.go cmd_reattach.go cmd_runner.go notes_unix.go process.go process_posix.go
- Version
- v1.6.3 (latest)
- Published
- Jan 23, 2025
- Platform
- linux/amd64
- Imports
- 17 packages
- Last checked
- 4 days ago –
Tools for package owners.