loadouts

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(ctx context.Context, loadout Loadout, exists ComponentExistsFunc) ([]components.Ref, error)

Resolve validates a loadout and returns deterministic concrete component refs.

func Validate

func Validate(loadout Loadout) error

Validate verifies a loadout schema without checking component existence.

Types

type ComponentExistsFunc

type ComponentExistsFunc func(ctx context.Context, ref components.Ref) (bool, error)

ComponentExistsFunc reports whether a concrete component ref exists.

type Loadout

type Loadout struct {
	APIVersion string              `json:"apiVersion" yaml:"apiVersion"`
	Kind       components.Kind     `json:"kind" yaml:"kind"`
	Metadata   components.Metadata `json:"metadata" yaml:"metadata"`
	Spec       Spec                `json:"spec" yaml:"spec"`
}

Loadout is a named bundle of normalized component references.

func (Loadout) Normalize

func (l Loadout) Normalize() Loadout

Normalize fills stable schema fields that are deterministic for loadouts.

func (Loadout) Ref

func (l Loadout) Ref() components.Ref

Ref returns the typed loadout ref.

func (Loadout) Summary

func (l Loadout) Summary() Summary

Summary returns a compact list representation.

type MissingComponentsError

type MissingComponentsError struct {
	Missing []components.Ref
}

MissingComponentsError lists concrete component refs missing from a loadout.

func (MissingComponentsError) Error

func (e MissingComponentsError) Error() string

Error returns a stable, human-readable missing-component message.

type Spec

type Spec struct {
	Components []components.Ref `json:"components" yaml:"components"`
}

Spec contains the explicit component refs that make up a loadout.

type Summary

type Summary struct {
	ID          string   `json:"id" yaml:"id"`
	Name        string   `json:"name,omitempty" yaml:"name,omitempty"`
	Description string   `json:"description,omitempty" yaml:"description,omitempty"`
	Tags        []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	Components  int      `json:"components" yaml:"components"`
}

Summary is a compact loadout listing record.

Jump to

Keyboard shortcuts

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