plugincontainer

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MPL-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReattachFunc

func ReattachFunc(logger hclog.Logger, id, hostSocketDir string) (runner.AttachedRunner, error)

Types

type ContainerRunner

type ContainerRunner struct {
	// contains filtered or unexported fields
}

ContainerRunner implements go-plugin's runner.Runner interface to run plugins inside a container.

func NewContainerRunner

func NewContainerRunner(logger hclog.Logger, cmd *exec.Cmd, cfg *config.ContainerConfig, hostSocketDir string) (*ContainerRunner, error)

NewContainerRunner must be passed a cmd that hasn't yet been started.

func (*ContainerRunner) Diagnose

func (c *ContainerRunner) Diagnose(_ context.Context) string

Diagnose prints out the container config to help users manually re-run the plugin for debugging purposes.

func (*ContainerRunner) HostToPlugin

func (c *ContainerRunner) HostToPlugin(hostNet, hostAddr string) (pluginNet string, pluginAddr string, err error)

func (*ContainerRunner) ID

func (c *ContainerRunner) ID() string

func (*ContainerRunner) Kill

func (c *ContainerRunner) Kill(ctx context.Context) error

func (*ContainerRunner) Name

func (c *ContainerRunner) Name() string

func (*ContainerRunner) PluginToHost

func (c *ContainerRunner) PluginToHost(pluginNet, pluginAddr string) (hostNet string, hostAddr string, err error)

func (*ContainerRunner) Start

func (c *ContainerRunner) Start(ctx context.Context) error

func (*ContainerRunner) Stderr

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

func (*ContainerRunner) Stdout

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

func (*ContainerRunner) Wait

func (c *ContainerRunner) Wait(ctx context.Context) error

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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