registry

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package registry provides TerraCi's plugin catalog and per-run plugin sets. Plugin packages register factories via init(); commands instantiate a fresh Registry from those factories for each app run. AppContext exposes only the registry's capability resolver surface to plugins.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByCapabilityFrom added in v0.10.0

func ByCapabilityFrom[T plugin.Plugin](source pluginSource) []T

ByCapabilityFrom returns all plugins from source that implement the given capability interface.

func RegisterFactory added in v0.10.0

func RegisterFactory(factory Factory)

RegisterFactory adds a plugin factory to the global catalog. Called from init() in plugin packages. Panics on duplicate names (fail-fast at startup).

func Reset

func Reset()

Reset clears the global catalog. Only for testing.

Types

type Catalog added in v0.10.0

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

Catalog stores plugin factories and creates isolated per-command plugin sets.

func NewCatalog added in v0.10.0

func NewCatalog() *Catalog

NewCatalog creates an empty plugin factory catalog.

func (*Catalog) NewRegistry added in v0.10.0

func (c *Catalog) NewRegistry() *Registry

NewRegistry instantiates a fresh plugin set from this catalog.

func (*Catalog) RegisterFactory added in v0.10.0

func (c *Catalog) RegisterFactory(factory Factory)

RegisterFactory adds a plugin factory to this catalog.

func (*Catalog) Reset added in v0.10.0

func (c *Catalog) Reset()

Reset clears the catalog. Only for testing.

type Factory added in v0.10.0

type Factory func() plugin.Plugin

Factory constructs a fresh plugin instance.

type Registry added in v0.10.0

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

Registry is an isolated plugin instance set for one app run. It is the framework-owned catalog for capability discovery, lifecycle hooks, command lookup, and plugin-visible capability resolution.

func New added in v0.10.0

func New() *Registry

New instantiates a fresh plugin set from the registered global factories.

func NewFromFactories added in v0.10.0

func NewFromFactories(factories ...Factory) *Registry

NewFromFactories creates an isolated registry from explicit factories without touching the process-wide plugin catalog.

func (*Registry) All added in v0.10.0

func (r *Registry) All() []plugin.Plugin

All returns plugins in registration order.

func (*Registry) CollectContributions added in v0.10.0

func (r *Registry) CollectContributions(ctx *plugin.AppContext) []*pipeline.Contribution

CollectContributions gathers pipeline contributions from all enabled PipelineContributor plugins in this registry.

func (*Registry) GetPlugin added in v0.10.0

func (r *Registry) GetPlugin(name string) (plugin.Plugin, bool)

GetPlugin returns a plugin by name.

func (*Registry) PreflightsForStartup added in v0.10.0

func (r *Registry) PreflightsForStartup() []plugin.Preflightable

PreflightsForStartup returns enabled plugins that participate in framework preflight for the current configuration state.

func (*Registry) ResolveBlobStoreProvider added in v0.10.0

func (r *Registry) ResolveBlobStoreProvider(name string, configPathHint ...string) (plugin.BlobStoreProvider, error)

ResolveBlobStoreProvider returns a named blob store backend provider. When name is empty, falls back to the single enabled blob store provider.

func (*Registry) ResolveCIProvider added in v0.10.0

func (r *Registry) ResolveCIProvider() (*plugin.ResolvedCIProvider, error)

ResolveCIProvider detects the active CI provider in this registry. Priority: TERRACI_PROVIDER env → CI environment detection → single active provider → error.

func (*Registry) ResolveChangeDetector added in v0.10.0

func (r *Registry) ResolveChangeDetector() (plugin.ChangeDetectionProvider, error)

ResolveChangeDetector returns the single active ChangeDetectionProvider.

func (*Registry) ResolveKVCacheProvider added in v0.10.0

func (r *Registry) ResolveKVCacheProvider(name string, configPathHint ...string) (plugin.KVCacheProvider, error)

ResolveKVCacheProvider returns a named KV cache backend provider. When name is empty, falls back to the single enabled KV cache provider — otherwise returns an error pointing at the available backends.

Jump to

Keyboard shortcuts

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