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 ¶
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
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