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 ¶
- func RegisterFactory(factory Factory)
- func Reset()
- type Catalog
- type Factory
- type Registry
- func (r *Registry) All() []plugin.Plugin
- func (r *Registry) CIInfoProviders() []plugin.CIInfoProvider
- func (r *Registry) CollectContributions(ctx *plugin.AppContext) ([]*pipeline.Contribution, error)
- func (r *Registry) CommandProviders() []plugin.CommandProvider
- func (r *Registry) ConfigLoaders() []plugin.ConfigLoader
- func (r *Registry) GetPlugin(name string) (plugin.Plugin, bool)
- func (r *Registry) Preflightables() []plugin.Preflightable
- func (r *Registry) PreflightsForStartup() []plugin.Preflightable
- func (r *Registry) ResolveBlobStoreProvider(name string, configPathHint ...string) (plugin.BlobStoreProvider, error)
- func (r *Registry) ResolveCIProvider() (*plugin.ResolvedCIProvider, error)
- func (r *Registry) ResolveChangeDetector() (plugin.ChangeDetectionProvider, error)
- func (r *Registry) ResolveKVCacheProvider(name string, configPathHint ...string) (plugin.KVCacheProvider, error)
- func (r *Registry) RuntimeProviders() []plugin.RuntimeProvider
- func (r *Registry) VersionProviders() []plugin.VersionProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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).
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
NewRegistry instantiates a fresh plugin set from this catalog.
func (*Catalog) RegisterFactory ¶ added in v0.10.0
RegisterFactory adds a plugin factory to this catalog.
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
NewFromFactories creates an isolated registry from explicit factories without touching the process-wide plugin catalog.
func (*Registry) CIInfoProviders ¶ added in v0.10.5
func (r *Registry) CIInfoProviders() []plugin.CIInfoProvider
CIInfoProviders returns CI metadata providers in registration order.
func (*Registry) CollectContributions ¶ added in v0.10.0
func (r *Registry) CollectContributions(ctx *plugin.AppContext) ([]*pipeline.Contribution, error)
CollectContributions gathers pipeline contributions from all enabled PipelineContributor plugins in this registry.
func (*Registry) CommandProviders ¶ added in v0.10.5
func (r *Registry) CommandProviders() []plugin.CommandProvider
CommandProviders returns command-capable plugins in registration order.
func (*Registry) ConfigLoaders ¶ added in v0.10.5
func (r *Registry) ConfigLoaders() []plugin.ConfigLoader
ConfigLoaders returns config-capable plugins in registration order.
func (*Registry) Preflightables ¶ added in v0.10.5
func (r *Registry) Preflightables() []plugin.Preflightable
Preflightables returns preflight-capable plugins in registration order.
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.
func (*Registry) RuntimeProviders ¶ added in v0.10.5
func (r *Registry) RuntimeProviders() []plugin.RuntimeProvider
RuntimeProviders returns runtime-capable plugins in registration order.
func (*Registry) VersionProviders ¶ added in v0.10.5
func (r *Registry) VersionProviders() []plugin.VersionProvider
VersionProviders returns version-capable plugins in registration order.