{"modulePath":"github.com/tobiash/gitops-preview-toolkit","version":"v0.2.0-rc.2","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package plugin\n\nPackage plugin defines the engine-independent contract for local render plugins.\n\n## Constants\n\n```go\nconst MaxMessageBytes = 64 \u003c\u003c 20\n```\nMaxMessageBytes bounds each serialized protobuf request and response (64 MiB).\n\n```go\nconst ProtocolVersion = 1\n```\n\n## Functions\n\n```go\nfunc Object(resource Resource) (map[string]any, error)\n```\nObject decodes exactly one Kubernetes object, retaining YAML scalar types.\n\n```go\nfunc ObjectID(object map[string]any) (string, error)\n```\nObjectID returns the concrete Kubernetes identity used across render engines.\n\n```go\nfunc Serve(ctx context.Context, socket string, service Service) (result error)\n```\nServe serves one persistent engine on a Unix socket until cancellation or a termination signal. Engines must honor RPC cancellation and support concurrent calls. Shutdown cancels outstanding calls before releasing engine resources. An engine implementing Close() error is closed exactly once, including on listener setup failure. Existing socket paths are never removed on startup.\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient owns a persistent connection and its executable. Close is idempotent and must be called by the owner; cancellation of Start's context also closes the client. Failed/uncertain RPCs invalidate the complete engine process.\n\n```go\nfunc Start(ctx context.Context, command Command) (*Client, error)\n```\nStart launches a trusted executable, appending --socket and a private socket path to its arguments, and verifies Describe before returning it.\n\n```go\nfunc StartWithOptions(ctx context.Context, command Command, options Options) (*Client, error)\n```\nStartWithOptions is Start with configurable transport timeouts.\n\n```go\nfunc (c *Client) Close() error\n```\nClose disconnects, signals the whole child process group, then kills it after the shutdown bound. It also kills surviving descendants after the leader exits.\n\n```go\nfunc (c *Client) CloseRender(ctx context.Context, request *CloseRequest) (*CloseResponse, error)\n```\n\n```go\nfunc (c *Client) Describe(ctx context.Context, request *DescribeRequest) (*DescribeResponse, error)\n```\n\n```go\nfunc (c *Client) Expand(ctx context.Context, request *ExpandRequest) (*ExpandResponse, error)\n```\n\n```go\nfunc (c *Client) OpenRender(ctx context.Context, request *OpenRequest) (*OpenResponse, error)\n```\n\n```go\ntype CloseRequest struct {\n\tSession string `json:\"session\"`\n}\n```\n\n```go\ntype CloseResponse struct{}\n```\n\n```go\ntype Command struct {\n\tName    string          `json:\"name\" yaml:\"name\"`\n\tCommand string          `json:\"command\" yaml:\"command\"`\n\tArgs    []string        `json:\"args,omitempty\" yaml:\"args,omitempty\"`\n\tConfig  json.RawMessage `json:\"config,omitempty\" yaml:\"-\"`\n}\n```\nCommand selects an executable from trusted startup configuration.\n\n```go\ntype DescribeRequest struct {\n\tProtocolVersion int `json:\"protocolVersion\"`\n}\n```\n\n```go\ntype DescribeResponse struct {\n\tProtocolVersion int    `json:\"protocolVersion\"`\n\tName            string `json:\"name\"`\n\tVersion         string `json:\"version\"`\n}\n```\n\n```go\ntype Diagnostic struct {\n\tCode       string `json:\"code\"`\n\tMessage    string `json:\"message\"`\n\tSeverity   string `json:\"severity\"`\n\tResourceID string `json:\"resourceId,omitempty\"`\n}\n```\n\n```go\ntype ExpandRequest struct {\n\tSession   string     `json:\"session\"`\n\tResources []Resource `json:\"resources\"`\n}\n```\n\n```go\ntype ExpandResponse struct {\n\tExpansions  []Expansion       `json:\"expansions\"`\n\tDiagnostics []Diagnostic      `json:\"diagnostics\"`\n\tEvidence    []json.RawMessage `json:\"evidence,omitempty\"`\n}\n```\nExpandResponse exhaustively describes all producers and current diagnostics. Evidence is informational and must never be fed back as observed cluster state.\n\n```go\ntype Expansion struct {\n\tID        string     `json:\"id\"`\n\tTrigger   string     `json:\"trigger\"`\n\tResources []Resource `json:\"resources\"`\n}\n```\nExpansion is a complete replacement of one producer's current desired output. Trigger is an inventory identity, or \"root\" for the configured source roots.\n\n```go\ntype OpenRequest struct {\n\tRunID        string          `json:\"runId,omitempty\"`\n\tRoot         string          `json:\"root\"`\n\tPaths        []string        `json:\"paths\"`\n\tRecursive    bool            `json:\"recursive\"`\n\tLocalOnly    bool            `json:\"localOnly\"`\n\tStrictInputs bool            `json:\"strictInputs\"`\n\tCluster      string          `json:\"cluster,omitempty\"`\n\tFresh        bool            `json:\"fresh,omitempty\"`\n\tConfig       json.RawMessage `json:\"config,omitempty\"`\n}\n```\nOpenRequest is trusted invocation configuration, never an instruction derived from Kubernetes annotations. A session belongs to one cluster and evaluation.\n\n```go\ntype OpenResponse struct {\n\tSession string `json:\"session\"`\n}\n```\n\n```go\ntype Options struct {\n\tStartupTimeout  time.Duration // Default 10 seconds.\n\tRPCTimeout      time.Duration // Default 2 minutes, including render calls.\n\tShutdownTimeout time.Duration // Default 10 seconds before SIGKILL, allowing runtime cleanup.\n}\n```\nOptions configures transport bounds. Zero durations select defaults; negative durations are invalid. Caller deadlines are always respected when shorter.\n\n```go\ntype Provenance struct {\n\tKind      string `json:\"kind,omitempty\"`\n\tName      string `json:\"name,omitempty\"`\n\tNamespace string `json:\"namespace,omitempty\"`\n\tPath      string `json:\"path,omitempty\"`\n\tText      string `json:\"text,omitempty\"`\n}\n```\n\n```go\ntype Resource struct {\n\tID         string     `json:\"id\"`\n\tYAML       string     `json:\"yaml\"`\n\tLogical    bool       `json:\"logical,omitempty\"`\n\tProvenance Provenance `json:\"provenance\"`\n}\n```\nResource is desired YAML and its stable preview identity. Logical identities identify unnamed composition outputs without inventing Kubernetes names.\n\n```go\nfunc ParseResource(data []byte, provenance Provenance) (Resource, error)\n```\nParseResource validates named YAML and attaches out-of-band provenance.\n\n```go\ntype Service interface {\n\tDescribe(context.Context, *DescribeRequest) (*DescribeResponse, error)\n\tOpenRender(context.Context, *OpenRequest) (*OpenResponse, error)\n\tExpand(context.Context, *ExpandRequest) (*ExpandResponse, error)\n\tCloseRender(context.Context, *CloseRequest) (*CloseResponse, error)\n}\n```\nService is implemented by engines and by the persistent gRPC client Adapter.\n\n","path":"github.com/tobiash/gitops-preview-toolkit/pkg/plugin","name":"plugin","synopsis":"Package plugin defines the engine-independent contract for local render plugins.","isRedistributable":true}
