pluginregistry

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package pluginregistry owns the explicit, versioned plugin installation registry used by generated Ridu applications.

Index

Constants

View Source
const CurrentVersion = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Key          string `json:"key"`
	GoPackage    string `json:"goPackage"`
	GoVersion    string `json:"goVersion"`
	Constructor  string `json:"constructor"`
	AdminPackage string `json:"adminPackage,omitempty"`
	AdminVersion string `json:"adminVersion,omitempty"`
}

Entry describes dependencies and the zero-argument constructor used to register one compiled plugin. Versions are dependency-manager requirements, not the runtime descriptor version reported by the plugin itself.

type Registry

type Registry struct {
	Version int     `json:"version"`
	Plugins []Entry `json:"plugins"`
}

Registry is the canonical input for the generated compiled-plugin registry.

func Load

func Load(path string) (Registry, error)

Load reads and validates a registry. A missing file is treated as an empty current-version registry so older hand-written projects can adopt the tool.

func (*Registry) Add

func (registry *Registry) Add(entry Entry) error

Add inserts one entry while preserving deterministic key order.

func (Registry) GoSource

func (registry Registry) GoSource(packageName string) ([]byte, error)

GoSource renders the only Go source file managed by plugin installation.

func (*Registry) Remove

func (registry *Registry) Remove(key string) (Entry, error)

Remove deletes one installed plugin and returns its dependency declaration.

func (Registry) Validate

func (registry Registry) Validate() error

Validate rejects ambiguous dependency or constructor declarations.

func (Registry) Write

func (registry Registry) Write(registryPath, goPath, packageName string) error

Write atomically writes the registry and its generated Go registration file.

Jump to

Keyboard shortcuts

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