{"modulePath":"github.com/tobiash/gitops-preview-toolkit","version":"v0.2.0-rc.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pluginhost\n\nPackage pluginhost evaluates persistent render plugins using bounded, synchronous desired-inventory sweeps. It never exposes an incomplete inventory.\n\n## Types\n\n```go\ntype Host struct {\n\t// contains filtered or unexported fields\n}\n```\nHost serializes evaluations and retains each lazily started process until Close.\n\n```go\nfunc New(commands []plugin.Command) (*Host, error)\n```\nNew constructs a host without starting any processes.\n\n```go\nfunc NewWithOptions(commands []plugin.Command, options Options) (*Host, error)\n```\nNewWithOptions constructs a host with explicit trusted root producers and bounds.\n\n```go\nfunc NewWithStarter(commands []plugin.Command, start Starter) (*Host, error)\n```\nNewWithStarter supports deterministic in-process engines and custom transports.\n\n```go\nfunc (h *Host) Close() error\n```\nClose releases all started processes. It is idempotent and waits for any active render, including its session cleanup, to finish.\n\n```go\nfunc (h *Host) Render(ctx context.Context, request plugin.OpenRequest) (result *Result, err error)\n```\nRender opens fresh sessions, computes a fixed point, and closes every opened session before returning. RPC, validation, timeout, or cleanup failures return an error and Complete=false with no resources. Stable engine errors likewise suppress resources, but are represented by diagnostics rather than a Go error. request.Config is a JSON object keyed by command name; each engine's object overrides matching top-level keys in that command's Config. An operation error retires every engine after session cleanup. A subsequent Render starts fresh processes; uncertain RPCs are never retried in this render.\n\n```go\ntype Options struct {\n\tStart Starter\n\t// RootPlugins approves additional root-producing command names. Flux is always trusted.\n\tRootPlugins   []string\n\tMaxIterations int           // Defaults to 64, and cannot exceed 64.\n\tTimeout       time.Duration // Defaults to five minutes, including startup and sweeps.\n}\n```\nOptions configures trusted startup policy, not resource-derived instructions.\n\n```go\ntype Result struct {\n\tResources   []plugin.Resource\n\tDiagnostics []plugin.Diagnostic\n\tEvidence    []json.RawMessage\n\tComplete    bool\n}\n```\nResult contains only a converged inventory. Diagnostics and evidence describe the last accepted sweep; evidence is never supplied to an engine as inventory.\n\n```go\ntype Starter func(context.Context, plugin.Command) (plugin.Service, func() error, error)\n```\nStarter starts a persistent service and returns its process cleanup function. A nil cleanup is permitted for in-process services. Services must honor context cancellation and must not retain or mutate request or response values.\n\n","path":"github.com/tobiash/gitops-preview-toolkit/pkg/pluginhost","name":"pluginhost","synopsis":"Package pluginhost evaluates persistent render plugins using bounded, synchronous desired-inventory sweeps.","isRedistributable":true}
