Documentation
¶
Overview ¶
Package host manages the lifecycle of external plugins — plugins that run as separate processes and communicate with the host over net/rpc.
This package handles the subprocess and RPC transport details for the exec: plugin type.
Index ¶
- func DescribePlugin(path string) (plugin.Descriptor, error)
- type Host
- func (h *Host) Evict(id string)
- func (h *Host) GetPlugin(id string) (plugin.Plugin, error)
- func (h *Host) IsAlive(id string) bool
- func (h *Host) LaunchPlugin(ctx context.Context, id, path string) (plugin.Plugin, error)
- func (h *Host) SampleWithTimeout(id string, timeout time.Duration) (plugin.Payload, error)
- func (h *Host) StopAll()
- func (h *Host) StopPlugin(id string) error
- type PluginHost
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DescribePlugin ¶
func DescribePlugin(path string) (plugin.Descriptor, error)
DescribePlugin launches a plugin binary, calls Describe(), kills it, and returns the descriptor. It never adds the process to the live clients map. Used by the catalog endpoint to get schema info without starting sampling.
Types ¶
type Host ¶
type Host struct {
// contains filtered or unexported fields
}
Host manages the lifecycle of external (subprocess) plugins.
func (*Host) Evict ¶
Evict removes a plugin's record so LaunchPlugin will start a fresh process. Call this after detecting a crash before attempting relaunch.
func (*Host) GetPlugin ¶
GetPlugin returns a previously launched plugin, or an error if not running.
func (*Host) LaunchPlugin ¶
LaunchPlugin starts an external plugin subprocess and returns the Plugin interface. If the plugin is already running, the existing instance is returned.
func (*Host) SampleWithTimeout ¶
SampleWithTimeout calls Sample() on a running plugin, returning an error if it doesn't respond within timeout.
func (*Host) StopPlugin ¶
StopPlugin terminates a running external plugin.