compile

package
v0.106.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package compile compiles BuildPlan resources by reading json encoded data from a reader, unmarshaling the data into a Component, building a CUE instance injecting the Component as a tag, then exporting a BuildPlan and marshalling the result to a writer represented as a stream of json objects. Each input component maps to one output json object in the stream.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildPlanRequest

type BuildPlanRequest struct {
	APIVersion string `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
	Kind       string `json:"kind,omitempty" yaml:"kind,omitempty"`
	Root       string `json:"root,omitempty" yaml:"root,omitempty"`
	Leaf       string `json:"leaf,omitempty" yaml:"leaf,omitempty"`
	WriteTo    string `json:"writeTo,omitempty" yaml:"writeTo,omitempty"`
	TempDir    string `json:"tempDir,omitempty" yaml:"tempDir,omitempty"`
	Tags       []string
}

BuildPlanRequest represents the complete context necessary to produce a BuildPlan. BuildPlanRequest is the primary input to the holos compile command, read from standard input. Provided by the holos render platform command.

type BuildPlanResponse

type BuildPlanResponse struct {
	APIVersion string          `json:"apiVersion,omitempty" yaml:"apiVersion,omitempty"`
	Kind       string          `json:"kind,omitempty" yaml:"kind,omitempty"`
	RawMessage json.RawMessage `json:"rawMessage,omitempty" yaml:"rawMessage,omitempty"`
}

func Compile

func Compile(ctx context.Context, concurrency int, reqs []BuildPlanRequest) (resp []BuildPlanResponse, err error)

type Compiler

type Compiler struct {
	R io.Reader
	W io.Writer
	// Encoding specifies "json" (default) or "yaml" format output.
	Encoding string
}

Compiler reads BuildPlanRequest objects from R and exports BuildPlanResponse objects to W.

func New

func New() *Compiler

New returns a new BuildPlan Compiler.

func (*Compiler) Run

func (c *Compiler) Run(ctx context.Context) error

Run reads a BuildPlanRequest from R and compiles a BuildPlan into a BuildPlanResponse on W. R and W are usually connected to stdin and stdout.

Jump to

Keyboard shortcuts

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