{"modulePath":"github.com/GoCodeAlone/go-plugin","version":"v1.7.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package runner\n\n## Types\n\n```go\ntype AddrTranslator interface {\n\t// Called before connecting on any addresses received back from the plugin.\n\tPluginToHost(pluginNet, pluginAddr string) (hostNet string, hostAddr string, err error)\n\n\t// Called on any host process addresses before they are sent to the plugin.\n\tHostToPlugin(hostNet, hostAddr string) (pluginNet string, pluginAddr string, err error)\n}\n```\nAddrTranslator translates addresses between the execution context of the host process and the plugin. For example, if the plugin is in a container, the file path for a Unix socket may be different between the host and the container.\n\nIt is only intended to be used by the host process.\n\n```go\ntype AttachedRunner interface {\n\t// Wait should wait until the plugin stops running, whether in response to\n\t// an out of band signal or in response to calling Kill().\n\tWait(ctx context.Context) error\n\n\t// Kill should stop the plugin and perform any cleanup required.\n\tKill(ctx context.Context) error\n\n\t// ID is a unique identifier to represent the running plugin. e.g. pid or\n\t// container ID.\n\tID() string\n\n\tAddrTranslator\n}\n```\nAttachedRunner defines a limited subset of Runner's interface to represent the reduced responsibility for plugin lifecycle when attaching to an already running plugin.\n\n```go\ntype ReattachFunc func() (AttachedRunner, error)\n```\nReattachFunc can be passed to a client's reattach config to reattach to an already running plugin instead of starting it ourselves.\n\n```go\ntype Runner interface {\n\t// Start should start the plugin and ensure any work required for servicing\n\t// other interface methods is done. If the context is cancelled, it should\n\t// only abort any attempts to _start_ the plugin. Waiting and shutdown are\n\t// handled separately.\n\tStart(ctx context.Context) error\n\n\t// Diagnose makes a best-effort attempt to return any debug information that\n\t// might help users understand why a plugin failed to start and negotiate a\n\t// connection.\n\tDiagnose(ctx context.Context) string\n\n\t// Stdout is used to negotiate the go-plugin protocol.\n\tStdout() io.ReadCloser\n\n\t// Stderr is used for forwarding plugin logs to the host process logger.\n\tStderr() io.ReadCloser\n\n\t// Name is a human-friendly name for the plugin, such as the path to the\n\t// executable. It does not have to be unique.\n\tName() string\n\n\tAttachedRunner\n}\n```\nRunner defines the interface required by go-plugin to manage the lifecycle of of a plugin and attempt to negotiate a connection with it. Note that this is orthogonal to the protocol and transport used, which is negotiated over stdout.\n\n","path":"github.com/GoCodeAlone/go-plugin/runner","name":"runner","synopsis":"","isRedistributable":true}
