plugin

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package plugin discovers and executes out-of-process Pacto plugins. A plugin is a pacto-plugin-<name> binary that reads a GenerateRequest as JSON on stdin and writes a GenerateResponse as JSON on stdout; the runner handles binary discovery, process lifecycle, and timeout enforcement so plugins can produce deployment artifacts from a contract.

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 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