engine

package
v1.13.1 Latest Latest
Warning

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

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

Documentation

Overview

Package engine is the facade the CLI plugin and the workbench call.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection = images.Connection

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func New

func New(opts Options) (*Engine, error)

func (*Engine) Apply

func (e *Engine) Apply(ctx context.Context, p *plan.Plan, approve string, allowDestructive bool, ev chan<- provider.Event) error

func (*Engine) ConfigureStore

func (e *Engine) ConfigureStore(ctx context.Context, options persistence.Options, expected string) error

func (*Engine) ConnectRegistry

func (e *Engine) ConnectRegistry(ctx context.Context, name, host, user, token string) error

func (*Engine) Connections

func (e *Engine) Connections(ctx context.Context) ([]Connection, error)

func (*Engine) Destroy

func (e *Engine) Destroy(ctx context.Context, target, env string, deleteData bool) error

func (*Engine) DestroyApproved

func (e *Engine) DestroyApproved(ctx context.Context, target, env string, deleteData bool, approval string) error

func (*Engine) Doctor

func (e *Engine) Doctor(ctx context.Context, target, env string, online bool) (output.Diagnostics, error)

Doctor runs preflight. Offline checks: config, decisions, tools on PATH, secret resolution through resolvers that need no network. online adds provider checks in plan 03 and later.

func (*Engine) Export

func (e *Engine) Export(ctx context.Context, p *plan.Plan, b *render.Bundle, dir string, force bool) (render.WriteResult, error)

func (*Engine) Files

func (e *Engine) Files(ctx context.Context) (SettingsView, error)

func (*Engine) History

func (e *Engine) History(ctx context.Context, target, env string) (state.Snapshot, error)

func (*Engine) Init

func (e *Engine) Init(ctx context.Context, answers map[string]string, write bool) (*InspectResult, map[string][]byte, error)

Init writes the suggested deploy block. answers maps a decision path to its chosen option. With write false it returns the bytes it would write.

func (*Engine) InitWithOptions

func (e *Engine) InitWithOptions(ctx context.Context, answers map[string]string, opts InitOptions) (*InspectResult, map[string][]byte, error)

func (*Engine) Inspect

func (e *Engine) Inspect(ctx context.Context, target, env string) (*InspectResult, error)

func (*Engine) InspectWithOptions

func (e *Engine) InspectWithOptions(ctx context.Context, target, env string, options InspectOptions) (*InspectResult, error)

func (*Engine) LifecycleState

func (e *Engine) LifecycleState(ctx context.Context, target, env string) (LifecycleState, error)

func (*Engine) LoadPlan

func (e *Engine) LoadPlan(ctx context.Context, hash string) (*plan.Plan, error)

func (*Engine) Logs

func (e *Engine) Logs(ctx context.Context, target, env, service string, opts provider.LogOptions) (io.ReadCloser, error)

func (*Engine) Plan

func (e *Engine) Plan(ctx context.Context, target, env string) (*plan.Plan, *render.Bundle, error)

func (*Engine) PlanPath

func (e *Engine) PlanPath(p *plan.Plan) string

func (*Engine) PlanWithOptions

func (e *Engine) PlanWithOptions(ctx context.Context, target, env string, opts PlanOptions) (*plan.Plan, *render.Bundle, error)

func (*Engine) Providers

func (e *Engine) Providers(ctx context.Context) []ProviderInfo

func (*Engine) PublishImages

func (e *Engine) PublishImages(ctx context.Context, p *plan.Plan, approved string, events chan<- provider.Event) (map[string]model.Image, error)

PublishImages verifies or publishes immutable images without changing workloads.

func (*Engine) Rollback

func (e *Engine) Rollback(ctx context.Context, target, env, release string) error

func (*Engine) RollbackApproved

func (e *Engine) RollbackApproved(ctx context.Context, target, env, release, approval string) error

func (*Engine) Root

func (e *Engine) Root() string

func (*Engine) Save

func (e *Engine) Save(ctx context.Context, expected string, ops []spec.Op) error

func (*Engine) SaveInit

func (e *Engine) SaveInit(ctx context.Context, res *InspectResult, files map[string][]byte) error

SaveInit writes the bytes from the reviewed proposal, after rechecking its sources.

func (*Engine) Status

func (e *Engine) Status(ctx context.Context, target, env string) (provider.Status, error)

type FileView

type FileView struct {
	Path    string `json:"path"`
	Hash    string `json:"hash"`
	Content string `json:"content"`
}

type InitOptions

type InitOptions struct{ Force, Write bool }

type InspectOptions

type InspectOptions struct {
	Execute bool
	App     string
}

type InspectResult

type InspectResult struct {
	Config      *config.ForgeConfig
	Revision    uint64
	Authority   persistence.Options
	Selection   []string
	Project     string
	InputHashes map[string]string
	Doc         *spec.Document
	Discovery   *discover.Result
	Catalog     *catalog.Catalog
	Deployment  *model.Deployment
	Target      string
	Environment string
	Diagnostics output.Diagnostics
}

type LifecycleState

type LifecycleState struct {
	Hash         string         `json:"hash"`
	Snapshot     state.Snapshot `json:"snapshot"`
	RecordedPlan *plan.Plan     `json:"recorded_plan,omitempty"`
}

type Options

type Options struct {
	ProviderFactories []provider.Factory
	Config            *config.ForgeConfig
	Runner            execx.Runner
	Mode              output.Mode
}

type PlanOptions

type PlanOptions struct{ Services []string }

type ProviderInfo

type ProviderInfo struct {
	Name  string `json:"name"`
	Level string `json:"level"`
}

type SettingsView

type SettingsView struct {
	Hash     string              `json:"hash"`
	Revision uint64              `json:"revision"`
	Store    persistence.Options `json:"store"`
	Files    []FileView          `json:"files"`
	Deploy   *spec.Deploy        `json:"deploy"`
}

Jump to

Keyboard shortcuts

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