pluginmarket

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package pluginmarket fetches the plugin registry index and installs verified binaries: the indexed sha256 is the trust root for every download.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asset

type Asset struct {
	SHA256 string   `json:"sha256"`
	URLs   []string `json:"urls"` // mirror first, upstream second
}

Asset is one platform binary of an indexed version.

type Entry

type Entry struct {
	Name        string    `json:"name"`
	DisplayName string    `json:"displayName"`
	Description string    `json:"description"`
	Repo        string    `json:"repo"`
	Homepage    string    `json:"homepage,omitempty"`
	License     string    `json:"license"`
	Maintainers []string  `json:"maintainers"`
	Versions    []Version `json:"versions"`
}

Entry is one plugin in the index.

type Index

type Index struct {
	SchemaVersion int     `json:"schemaVersion"`
	GeneratedBy   string  `json:"generatedBy"`
	Plugins       []Entry `json:"plugins"`
}

Index is the registry document.

type Service

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

Service fetches and caches the registry index. Multiple URLs merge by plugin name, first wins — operators can front the official registry with their own.

func New

func New(urls []string) *Service

func (*Service) Entries

func (s *Service) Entries(ctx context.Context) ([]Entry, error)

Entries returns the merged catalog; a URL that fails keeps serving its last good copy.

func (*Service) Entry

func (s *Service) Entry(ctx context.Context, name string) (Entry, error)

func (*Service) Install

func (s *Service) Install(ctx context.Context, e Entry, v Version, dir string) (string, error)

Install downloads the host-platform binary (mirror URL first), verifies the indexed sha256, and atomically places it in dir under the plugin's name.

type Version

type Version struct {
	Version         string           `json:"version"`
	APIVersion      int              `json:"apiVersion"`
	ProtocolVersion int              `json:"protocolVersion"`
	Yanked          bool             `json:"yanked,omitempty"`
	Assets          map[string]Asset `json:"assets"`
	Icon            plugin.Icon      `json:"icon"`
	SnapshotURL     string           `json:"snapshotUrl"`
}

Version is one installable plugin version from the index.

func FindVersion

func FindVersion(e Entry, version string) (Version, error)

func Installable

func Installable(e Entry) (Version, bool)

Installable returns the newest runnable version (versions are ordered newest first in the index).

Jump to

Keyboard shortcuts

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