Help us shape the future of Go! Take the 2026 Go Developer Survey

manifest

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 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"`
}

Dependency declares a plugin dependency and its version requirement.

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

SameOwner reports whether plugin, kind, and name match, regardless of release.

func (Distribution) Validate

func (d Distribution) Validate() error

Validate validates the plugin, release, distribution kind, and semantic name.

type DistributionKind

type DistributionKind string

DistributionKind identifies a plugin distribution category.

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

type ID

type ID string

ID identifies a plugin.

func (ID) Validate

func (id ID) Validate() error

Validate checks that the plugin identifier is semantic.

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

Snapshot returns a manifest copy with an independent dependency slice.

func (Manifest) Validate

func (m Manifest) Validate() error

Validate checks manifest identities, requirements, namespace, declaration bounds, and duplicate dependencies.

type Requirement

type Requirement string

Requirement expresses a plugin or framework version constraint.

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

Validate checks that the version requirement can be parsed.

type Version

type Version string

Version identifies a plugin release version.

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

Validate checks that the version can be parsed.

Jump to

Keyboard shortcuts

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