toolplugin

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package toolplugin is the plugin side of tool plugins: ServeTool turns an ordinary tool.Module (the same Register func a built-in tool uses) into a binary that serves HTTP on the unix socket the host names, while the host reverse-proxies /tools/{key}/* to it and wraps page fragments in wick's layout.

It lives apart from pkg/plugin so connector binaries, which import pkg/plugin, do not link pkg/tool and its templ render stack.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(mod tool.Module, cfg map[string]string) http.Handler

Handler returns the plugin's HTTP handler for mod without serving it — for tests and local harnesses. cfg seeds the config store.

func Manifest

func Manifest(mod tool.Module, opts ...Option) wickplugin.ToolModule

Manifest returns the tool half of mod's manifest (routes are registered to discover the webhooks).

func ServeTool

func ServeTool(mod tool.Module, opts ...Option)

ServeTool is the entire main() of a tool plugin binary. With --dump-manifest it prints the kind=tool manifest and exits; otherwise it serves HTTP on $WICK_PLUGIN_SOCKET plus the Tool control service until the host kills it.

func UserFromHeaders

func UserFromHeaders(r *http.Request) (tool.User, bool)

UserFromHeaders reads the signed-in user the host injected. ok is false when the request carries no session (webhooks, public tools).

Types

type Option

type Option func(*wickplugin.ToolModule)

Option tunes a tool plugin's manifest.

func KeepWarm

func KeepWarm() Option

KeepWarm marks the tool to stay running instead of being idle-killed. Use it for tools whose webhook must answer within a few seconds.

Jump to

Keyboard shortcuts

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