manifest

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package manifest contains plugin declarations without importing application assembly or concrete features. Use package plugin when implementing a plugin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	ID      ID          `json:"id"`
	Version Requirement `json:"version"`
}

type Distribution

type Distribution struct {
	Plugin  ID               `json:"plugin"`
	Release Version          `json:"release"`
	Kind    DistributionKind `json:"kind"`
	Name    string           `json:"name"`
}

Distribution identifies one independently published bundle. Its ownership is stable across releases; a different plugin, kind or name is a different owner.

func (Distribution) SameOwner

func (d Distribution) SameOwner(other Distribution) bool

func (Distribution) Validate

func (d Distribution) Validate() error

type DistributionKind

type DistributionKind string
const (
	Assets   DistributionKind = "assets"
	Scaffold DistributionKind = "scaffold"
)

type ID

type ID string

func (ID) Validate

func (id ID) Validate() error

type Manifest

type Manifest struct {
	ID          ID          `json:"id"`
	Version     Version     `json:"version"`
	Framework   Requirement `json:"framework"`
	Description string      `json:"description,omitempty"`
	// ConfigNamespace optionally declares a full plugins.* namespace when the
	// semantic ID cannot be used as a configuration key (for example a hyphen).
	ConfigNamespace string       `json:"config_namespace,omitempty"`
	Dependencies    []Dependency `json:"dependencies,omitempty"`
}

Manifest is copied at registration. Description is display-only; identity, compatibility and dependencies are validated before any registration callback.

func (Manifest) Namespace

func (m Manifest) Namespace() (string, error)

Namespace returns the exact configuration prefix; IDs are never sanitized.

func (Manifest) Snapshot

func (m Manifest) Snapshot() Manifest

func (Manifest) Validate

func (m Manifest) Validate() error

type Requirement

type Requirement string

func (Requirement) Accepts

func (r Requirement) Accepts(v Version) (bool, error)

Accepts supports semantic ranges, including caret, tilde and comparisons. Prereleases require an explicit prerelease comparator in the matching range.

func (Requirement) Validate

func (r Requirement) Validate() error

type Version

type Version string
const FrameworkVersion Version = "0.1.0"

FrameworkVersion is the plugin API compatibility version of this framework release. It is independent of the Go toolchain and plugin payload versions.

func (Version) Compare

func (v Version) Compare(other Version) (int, error)

Compare uses semantic precedence, ignoring build metadata.

func (Version) Validate

func (v Version) Validate() error

Jump to

Keyboard shortcuts

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