manifest

package
v0.1.0-dev.20260216095753 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 7 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 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