cmdrunner

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: MPL-2.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
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) HostToPlugin(hostNet, hostAddr string) (string, string, error)

func (*CmdAttachedRunner) ID

func (c *CmdAttachedRunner) ID() string

func (*CmdAttachedRunner) Kill

func (*CmdAttachedRunner) PluginToHost

func (*CmdAttachedRunner) PluginToHost(pluginNet, pluginAddr string) (string, string, error)

func (*CmdAttachedRunner) Wait

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

func NewCmdRunner(logger hclog.Logger, cmd *exec.Cmd) (*CmdRunner, error)

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 (c *CmdRunner) Diagnose(_ context.Context) string

func (*CmdRunner) HostToPlugin

func (*CmdRunner) HostToPlugin(hostNet, hostAddr string) (string, string, error)

func (*CmdRunner) ID

func (c *CmdRunner) ID() string

func (*CmdRunner) Kill

func (c *CmdRunner) Kill(_ context.Context) error

func (*CmdRunner) Name

func (c *CmdRunner) Name() string

func (*CmdRunner) PluginToHost

func (*CmdRunner) PluginToHost(pluginNet, pluginAddr string) (string, string, error)

func (*CmdRunner) Start

func (c *CmdRunner) Start(_ context.Context) error

func (*CmdRunner) Stderr

func (c *CmdRunner) Stderr() io.ReadCloser

func (*CmdRunner) Stdout

func (c *CmdRunner) Stdout() io.ReadCloser

func (*CmdRunner) Wait

func (c *CmdRunner) Wait(_ context.Context) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL