reg

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package reg provides the v4 multi-registry plugin manager. Supports online fetch with offline cache fallback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstalledPlugin

type InstalledPlugin struct {
	Name      string `json:"name"`
	Version   string `json:"version"`
	Source    string `json:"source"`
	Path      string `json:"path"`
	Checksum  string `json:"checksum"`
	Installed string `json:"installed"`
	Running   bool   `json:"running"`
}

InstalledPlugin tracks a locally installed plugin.

type LockEntry

type LockEntry struct {
	Version  string `json:"version"`
	Source   string `json:"source"`
	Checksum string `json:"checksum"`
}

LockEntry pins one plugin version.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages plugin discovery, installation, and versioning.

func NewManager

func NewManager(pluginDir, cacheDir string, sources []Source) *Manager

NewManager creates a plugin manager.

func (*Manager) ClearCache

func (m *Manager) ClearCache()

ClearCache purges the offline cache (forces fresh fetch next time).

func (*Manager) Install

func (m *Manager) Install(ctx context.Context, name string) (*InstalledPlugin, error)

Install downloads and registers a plugin by name.

func (*Manager) ListInstalled

func (m *Manager) ListInstalled() []*InstalledPlugin

ListInstalled returns all locally installed plugins.

func (*Manager) Lock

func (m *Manager) Lock() map[string]LockEntry

Lock returns a version-lock snapshot of installed plugins.

func (*Manager) Remove

func (m *Manager) Remove(name string) error

Remove deletes a locally installed plugin.

func (*Manager) Search

func (m *Manager) Search(ctx context.Context, query string) ([]PluginMeta, error)

Search queries all registries, returns deduplicated results sorted by relevance.

type PluginMeta

type PluginMeta struct {
	Name         string   `json:"name"`
	Description  string   `json:"description"`
	Version      string   `json:"version"`
	URL          string   `json:"url"`
	Checksum     string   `json:"checksum"`
	Homepage     string   `json:"homepage"`
	Tags         []string `json:"tags"`
	MinOKVersion string   `json:"min_ok_version"`
	License      string   `json:"license"`
	Author       string   `json:"author"`
	SignedBy     string   `json:"signed_by,omitempty"`
}

PluginMeta describes one available plugin.

type Source

type Source struct {
	Name     string `json:"name"`
	URL      string `json:"url"`
	Priority int    `json:"priority"`
	Auth     string `json:"auth,omitempty"`
}

Source describes one plugin registry.

Jump to

Keyboard shortcuts

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