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 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 ¶
Namespace returns the exact configuration prefix; IDs are never sanitized.
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.