addonregistry

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const CurrentSchemaVersion = 1

Variables

This section is empty.

Functions

func Validate

func Validate(registry Registry) []error

Types

type Constructor

type Constructor struct {
	Addable    bool   `json:"addable"`
	Package    string `json:"package"`
	Function   string `json:"function"`
	Options    string `json:"options,omitempty"`
	OptionsCLI string `json:"optionsCLI,omitempty"`
}

type Entry

type Entry struct {
	Name                  string      `json:"name"`
	Summary               string      `json:"summary"`
	Description           string      `json:"description"`
	Kind                  string      `json:"kind"`
	Lifecycle             string      `json:"lifecycle"`
	Compatibility         string      `json:"compatibility"`
	MinGOWDK              string      `json:"minGOWDK,omitempty"`
	MaxGOWDK              string      `json:"maxGOWDK,omitempty"`
	ModulePath            string      `json:"modulePath"`
	PackagePath           string      `json:"packagePath"`
	ImportPath            string      `json:"importPath"`
	Owner                 string      `json:"owner"`
	SourceRepository      string      `json:"sourceRepository"`
	License               string      `json:"license"`
	Documentation         string      `json:"documentation"`
	Features              []string    `json:"features,omitempty"`
	PublicInterfaces      []string    `json:"publicInterfaces,omitempty"`
	RequiredExternalTools []string    `json:"requiredExternalTools,omitempty"`
	NetworkBehavior       []string    `json:"networkBehavior,omitempty"`
	ProcessBehavior       []string    `json:"processBehavior,omitempty"`
	SecurityNotes         []string    `json:"securityNotes,omitempty"`
	Trust                 Trust       `json:"trust"`
	Constructor           Constructor `json:"constructor"`
}

func (Entry) SupportsVersion added in v0.6.0

func (e Entry) SupportsVersion(version string) VersionSupport

SupportsVersion reports whether the queried GOWDK version satisfies the entry's declared [MinGOWDK, MaxGOWDK] bounds. This is the version handshake: an addon declares the versions it targets and tooling can check a concrete CLI version against it before wiring or trusting the addon.

Bounds are inclusive. An unset bound is open on that side. If either relevant bound or the queried version cannot be parsed as a dotted numeric version, the result is VersionUnknown so a caller warns rather than wrongly blocking.

type Registry

type Registry struct {
	SchemaVersion int     `json:"schemaVersion"`
	Addons        []Entry `json:"addons"`
}

func Bundled

func Bundled() (Registry, error)

func Parse

func Parse(contents []byte) (Registry, error)

func (Registry) UnsupportedFor added in v0.6.0

func (r Registry) UnsupportedFor(version string) []Entry

UnsupportedFor returns the entries whose declared version bounds exclude the queried version. Entries with unknown (unparseable or unset) bounds are not reported, because their incompatibility cannot be proven.

type Trust

type Trust struct {
	Level string `json:"level"`
	Notes string `json:"notes"`
}

type VersionSupport added in v0.6.0

type VersionSupport int

VersionSupport is the result of checking a registry entry's declared GOWDK-version bounds against a concrete CLI version.

const (
	// VersionUnknown means the bounds or the queried version could not be
	// compared (an unset or unparseable bound), so compatibility cannot be
	// proven either way. Callers should warn, not hard-fail.
	VersionUnknown VersionSupport = iota
	// VersionSupported means the queried version is within the declared bounds.
	VersionSupported
	// VersionUnsupported means the queried version is below MinGOWDK or above
	// MaxGOWDK.
	VersionUnsupported
)

Jump to

Keyboard shortcuts

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