runner

package
v0.8.0-a.15 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package runner is the CLI scaffolding every compiled factory binary links into. The generated `main.go` stays tiny: it embeds the factory-specific constants and calls Run with them.

Index

Constants

View Source
const EnvVarPrefix = "UB_VAR_"

EnvVarPrefix is the prefix unobin reads input overrides from. An env var like `UB_VAR_cluster_name=web-prod` overrides the `cluster-name` input, with snake case converted to kebab case.

Variables

This section is empty.

Functions

func Run

func Run(info Info)

Run builds the cobra command tree and executes it. The process exits with status code 1 on error.

Types

type Format

type Format string

Format is the wire form a subcommand emits. The text form is the existing human-facing rendering; json emits NDJSON envelopes (one per line); unobin emits the same envelope shape encoded as UB literals, one per line.

const (
	FormatText   Format = "text"
	FormatJSON   Format = "json"
	FormatUnobin Format = "unobin"
)

func ParseFormat

func ParseFormat(s string) (Format, error)

ParseFormat resolves the value of the --output flag. An empty string maps to text so commands with the flag-default of "" pick up the same behavior as commands without the flag.

type Info

type Info struct {
	FactoryName     string
	FactoryVersion  string
	ContentRevision string
	FactoryBody     string
	LibraryPath     string
	Libraries       map[string]*runtime.Library

	// UnobinVersion is the unobin version the factory was compiled
	// against, stamped at link time the way FactoryVersion is. Run
	// refuses to start when the binary links a different one; empty
	// (built outside the CLI) checks nothing.
	UnobinVersion string
}

Info bundles everything a generated factory binary passes into Run. FactoryBody is the embedded factory source the binary parses on each invocation. LibraryPath is the binary's library-path identity (the same form Go libraries use); the operator's stack file asserts the same value under `factory.pin.library-path`. An empty LibraryPath disables that identity check.

Jump to

Keyboard shortcuts

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