registry

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package registry fetches and caches the Kleff plugin catalog from the remote plugin registry (by default, github.com/kleff/plugin-registry).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

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

Registry implements ports.PluginRegistry by fetching a JSON catalog from a remote URL and caching the result for a configurable TTL.

func New

func New(catalogURL string, ttl time.Duration) *Registry

New creates a Registry. catalogURL defaults to the official registry if empty. ttl controls the cache lifetime (default: 1 hour).

func (*Registry) CachedAt

func (r *Registry) CachedAt() string

CachedAt returns the RFC3339 timestamp of the last successful fetch.

func (*Registry) GetManifest

func (r *Registry) GetManifest(ctx context.Context, pluginID string) (*domain.CatalogManifest, error)

GetManifest returns the catalog entry for the given plugin ID, or nil, nil. Builtin plugins are checked first.

func (*Registry) ListCatalog

func (r *Registry) ListCatalog(ctx context.Context) ([]*domain.CatalogManifest, error)

ListCatalog returns the cached catalog merged with builtin plugins, refreshing if stale. Builtin plugins always appear first and are never overridden by the remote catalog.

func (*Registry) Refresh

func (r *Registry) Refresh(ctx context.Context) error

Refresh forces a re-fetch from the remote registry.

Jump to

Keyboard shortcuts

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