plugin

package
v0.27.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ProtocolVersion = "1"

ProtocolVersion is the current plugin protocol version.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateRequest

type GenerateRequest struct {
	ProtocolVersion string             `json:"protocolVersion"`
	Contract        *contract.Contract `json:"contract"`
	BundleDir       string             `json:"bundleDir"`
	OutputDir       string             `json:"outputDir"`
	Options         map[string]any     `json:"options,omitempty"`
}

GenerateRequest is the JSON payload written to a plugin's stdin.

type GenerateResponse

type GenerateResponse struct {
	Files   []GeneratedFile `json:"files"`
	Message string          `json:"message,omitempty"`
}

GenerateResponse is the JSON payload read from a plugin's stdout.

type GeneratedFile

type GeneratedFile struct {
	Path    string `json:"path"`
	Content string `json:"content"`
}

GeneratedFile describes a single file produced by a plugin.

type Runner

type Runner interface {
	Run(ctx context.Context, name string, req GenerateRequest) (*GenerateResponse, error)
}

Runner executes a plugin by name with the given request.

type SubprocessRunner

type SubprocessRunner struct{}

SubprocessRunner discovers and executes plugin binaries via stdin/stdout JSON.

func (*SubprocessRunner) Run

Run finds the plugin binary, spawns it, writes the request JSON to stdin, and reads the response JSON from stdout.

Jump to

Keyboard shortcuts

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