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 ¶
IsManifestFile returns true if the filename is a packages-manifest file.
func Validate ¶
Validate validates a packages-manifest file against the embedded JSON schema. Returns nil if valid, or an error describing the validation failure.
func ValidateBytes ¶
ValidateBytes validates packages-manifest content against the embedded JSON schema.
Types ¶
type Builder ¶
type Builder struct{}
Builder implements engine.GraphBuilder 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) BuildGraph ¶
func (b *Builder) BuildGraph(ctx context.Context, manifestPath string, opts engine.BuildOptions) (*engine.Graph, error)
BuildGraph loads a packages-manifest file and builds an execution graph. This is the engine.GraphBuilder interface implementation.
Entry point 1: Load, validate, and build from file path.
func (*Builder) BuildGraphFromManifest ¶
func (b *Builder) BuildGraphFromManifest(ctx context.Context, manifest *PackagesManifest, opts engine.BuildOptions) (*engine.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).
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.