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 ¶
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 ¶
func (r *SubprocessRunner) Run(ctx context.Context, name string, req GenerateRequest) (*GenerateResponse, error)
Run finds the plugin binary, spawns it, writes the request JSON to stdin, and reads the response JSON from stdout.
Click to show internal directories.
Click to hide internal directories.