manifest

package
v0.1.0-dev.20260213032713 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package manifest provides loading and validation for packages-manifest files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsManifestFile

func IsManifestFile(filename string) bool

IsManifestFile returns true if the filename is a packages-manifest file.

func Validate

func Validate(path string) error

Validate validates a packages-manifest file against the embedded JSON schema. Returns nil if valid, or an error describing the validation failure.

func ValidateBytes

func ValidateBytes(data []byte, path string) error

ValidateBytes validates packages-manifest content against the embedded JSON schema.

Types

type Builder

type Builder struct{}

Builder implements execution.SubgraphBuilder for packages-manifest files. It translates a packages-manifest into an execution graph that lore can process to install software.

func NewBuilder

func NewBuilder() *Builder

NewBuilder creates a new packages-manifest graph builder.

func (*Builder) BuildGraphFromManifest

func (b *Builder) BuildGraphFromManifest(ctx context.Context, manifest *PackagesManifest, opts execution.BuildOptions) (*execution.Graph, error)

BuildGraphFromManifest builds an execution graph from an already-parsed manifest.

Entry point 2: Build from pre-parsed manifest (for callers who already have the data).

func (*Builder) BuildSubgraph

func (b *Builder) BuildSubgraph(ctx context.Context, manifestPath string, opts execution.BuildOptions) (*execution.Graph, error)

BuildSubgraph loads a packages-manifest file and builds an execution graph. This is the execution.SubgraphBuilder interface implementation.

Entry point 1: Load, validate, and build from file path.

type PackageEntry

type PackageEntry struct {
	// Name is the package name.
	Name string

	// With is a list of features to enable.
	With []string
}

PackageEntry represents a single package in the manifest. It can be either a simple string (package name) or an object with options.

func (PackageEntry) String

func (e PackageEntry) String() string

String returns a human-readable representation of the package entry.

type PackageOptions

type PackageOptions struct {
	With []string `json:"with" yaml:"with"`
}

PackageOptions holds the options for a package (used during parsing).

type PackagesManifest

type PackagesManifest struct {
	// Packages is the list of package entries.
	Packages []PackageEntry `json:"packages" yaml:"packages"`
}

PackagesManifest represents the parsed packages-manifest.{yaml,json} file.

func Load

func Load(path string) (*PackagesManifest, error)

Load reads and parses a packages-manifest file from the given path. Supports both YAML and JSON formats based on file extension.

func Parse

func Parse(data []byte, path string) (*PackagesManifest, error)

Parse parses packages-manifest content from bytes. The path is used to determine the format (yaml/json).

func (*PackagesManifest) PackageNames

func (m *PackagesManifest) PackageNames() []string

PackageNames returns the list of package names from the manifest.

Jump to

Keyboard shortcuts

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