Help us shape the future of Go! Take the 2026 Go Developer Survey

runtime

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Overview

Package runtime runs the actions of a bundle's installations, as a CNAB runtime: it builds the claim, hands the operation to the driver that runs the invocation image, and returns the claim, its result and its outputs. It knows nothing about orchestrators: the target names one, and the installer applies it.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("not implemented")

ErrNotImplemented is returned for what is planned but not built yet.

Functions

func Connect

func Connect(deploymentTarget target.Target) (client.APIClient, error)

Connect returns the Engine API of the target's Docker, reached as the docker CLI reaches it: what a status or the logs read.

Types

type FailedError

type FailedError struct {
	Action       string
	Installation string
	// Cause is how the installer ended; its output says why.
	Cause string
}

FailedError is an action the installer ran, and that failed.

func (*FailedError) Error

func (failed *FailedError) Error() string

type Request

type Request struct {
	Bundle cnab.ExtendedBundle
	// Stack is the stack the installation belongs to. The installation is
	// named <stack>/<bundle>.
	Stack  string
	Action string
	// Target receives the deployment; Installer says where the invocation
	// image runs.
	Target    target.Target
	Installer target.Installer

	// Parameters holds the values given for the bundle's parameters, as
	// text. They are converted to the type their definition says.
	Parameters map[string]string

	// Credentials holds the resolved values of the bundle's credentials.
	Credentials valuesource.Set

	// Relocation maps the bundle's images to where they are, when the
	// bundle was pulled from a registry: the invocation image runs from
	// there, and the installer gets the map.
	Relocation relocation.ImageRelocationMap

	// Source is where the bundle came from, a bundle.json or a location:
	// its images are read from there when the target loads them. It is the
	// claim's bundleReference.
	Source string

	// Custom is what the runtime records in the claim besides CNAB's own.
	Custom any

	// Progress receives the events of the action, about its installation:
	// the loading of its images, and what its installer does.
	Progress progress.Sink
}

Request is one action on one installation.

type Run

type Run struct {
	Claim   cnab.Claim
	Result  cnab.Result
	Outputs map[string]string
}

Run is what an action did.

func Execute

func Execute(ctx context.Context, request Request) (Run, error)

Execute runs the action. The error is set when the action could not run, or when it ran and failed; the Run is filled as far as the action went.

Jump to

Keyboard shortcuts

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