pluginhost

package
v0.4.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package pluginhost launches out-of-process plugin binaries (<pluginsDir>/<name>/plugin), each listening on a private unix socket, and reverse-proxies their HTTP routes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

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

func New

func New(pluginsDir, runtimeDir, agentURL, token string) *Host

func (*Host) Builtin

func (h *Host) Builtin(name, path string, args ...string)

Builtin registers a plugin shipped inside the agent, launched by running the given command (typically the agent re-execing itself with a subcommand). Call before Start.

func (*Host) ExecTool

func (h *Host) ExecTool(plugin, tool string, args map[string]any) (string, error)

ExecTool invokes a tool on a running plugin over its socket and returns the textual result.

func (*Host) Infos

func (h *Host) Infos() []pluginapi.Info

func (*Host) Proxy

func (h *Host) Proxy(name string) (*httputil.ReverseProxy, bool)

Proxy returns a running plugin's reverse proxy. The caller must set the request path relative to the plugin (strip the /plugin/<name> prefix) before serving.

func (*Host) Start

func (h *Host) Start() error

Start launches the built-in plugins and every external plugin binary; a plugin that fails to launch is logged and skipped.

func (*Host) Stop

func (h *Host) Stop()

Jump to

Keyboard shortcuts

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