manifest

package
v0.1.0-dev.20260914030948 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

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

It lives at the repository root's internal/ deliberately, and not under cmd/internal (#742): a document format is domain, not command-line presentation. lore and writ are its readers today, and a pkg/ reader of the same format would be legitimate; cmd/internal would forbid it for no reason the format supplies.

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.

Parameters:

  • filename: file path or name to check

Returns:

  • bool: true for packages-manifest.yaml or packages-manifest.json

func Validate

func Validate(path string) error

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

Parameters:

  • path: filesystem path to the manifest file

Returns:

  • error: validation error or nil

Types

type PackageEntry

type PackageEntry struct {
	Name string   `json:"name" yaml:"name"`                     // package name (required)
	With []string `json:"with,omitempty" yaml:"with,omitempty"` // features to enable
}

PackageEntry represents a single package in the manifest.

func (*PackageEntry) String

func (e *PackageEntry) String() string

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

Returns:

  • string: name alone or name with --with flags

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.

Parameters:

  • path: filesystem path to the manifest file

Returns:

  • *PackagesManifest: parsed manifest
  • error: read or parse error

func (*PackagesManifest) PackageNames

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

PackageNames returns the list of package names from the manifest.

Returns:

  • []string: names extracted from each package entry

Jump to

Keyboard shortcuts

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