resourcepack

package
v0.1.56 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package resourcepack plans and applies immutable, parameterized resource configuration packages. It deliberately has no provider or guest-transport dependency: those are supplied by the executor at the application boundary.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRegistryRequired    = errors.New("resource package registry is required")
	ErrExecutorRequired    = errors.New("resource package executor is required")
	ErrUnsupportedMethod   = errors.New("resource package method is not supported")
	ErrInvalidManifest     = errors.New("resource package manifest is invalid")
	ErrInvalidPackageScope = errors.New("resource package scope is invalid for event")
)

Functions

This section is empty.

Types

type AppliedPackage

type AppliedPackage struct {
	Reference   string `json:"reference" yaml:"reference"`
	InputDigest string `json:"input_digest" yaml:"input_digest"`
}

type Engine

type Engine struct {
	Registry artifact.Registry
}

func (Engine) Apply

func (e Engine) Apply(ctx context.Context, plan Plan, executor Executor) ([]AppliedPackage, error)

func (Engine) Plan

func (e Engine) Plan(ctx context.Context, request Request) (Plan, error)

type Event

type Event string
const (
	EventProvision  Event = "provision"
	EventPromotion  Event = "promotion"
	EventAllocation Event = "allocation"
)

type Executor

type Executor interface {
	Execute(ctx context.Context, target Target, operation Operation) error
}

Executor is the only side-effecting dependency of Engine.Apply.

type Manifest

type Manifest struct {
	Name     string         `json:"name" yaml:"name"`
	Version  string         `json:"version" yaml:"version"`
	Method   Method         `json:"method" yaml:"method"`
	Scopes   []Scope        `json:"scopes" yaml:"scopes"`
	Events   []Event        `json:"events" yaml:"events"`
	Defaults map[string]any `json:"defaults,omitempty" yaml:"defaults,omitempty"`
	Inputs   map[string]any `json:"inputs,omitempty" yaml:"inputs,omitempty"`
}

Manifest is the typed content of a published resource package.

func (Manifest) Validate

func (m Manifest) Validate() error

type Method

type Method string
const (
	MethodShell      Method = "shell"
	MethodPowerShell Method = "powershell"
	MethodDSC        Method = "dsc"
	MethodAnsible    Method = "ansible"
)

func (Method) Supported

func (m Method) Supported() bool

Supported reports whether Boxy currently has an executor for the method. DSC and Ansible remain valid manifest vocabulary for future implementations, but cannot be used by the current lifecycle executor.

type Operation

type Operation struct {
	Reference   string
	Method      Method
	Inputs      map[string]any
	Parameters  map[string]any
	InputDigest string
	Content     []byte
}

type Plan

type Plan struct {
	Target   Target
	Event    Event
	Packages []PlannedPackage
}

type PlannedPackage

type PlannedPackage struct {
	Reference   string
	Manifest    Manifest
	Inputs      map[string]any
	Parameters  map[string]any
	InputDigest string
	Content     []byte
}

type Request

type Request struct {
	Target     Target
	Event      Event
	Scope      Scope
	References []string
	Overrides  map[string]any
	Applied    []AppliedPackage
}

Request describes one lifecycle package application.

type Scope

type Scope string
const (
	ScopeResource   Scope = "resource"
	ScopeAllocation Scope = "allocation"
)

type Target

type Target struct {
	ResourceID string
	Provider   string
	AgentID    string
}

Target identifies the concrete resource receiving an operation. Provider and credential details remain opaque to this package and may be carried by the executor's adapter.

Jump to

Keyboard shortcuts

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