registry

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package registry is the single source of truth for provider self-description. Each pkg/providers/<x>/ registers its Spec at init() time; runner/catalog and other consumers read aggregated views from here.

Dependency direction is intentional and load-bearing:

  • registry imports only standard library + utils
  • pkg/providers/<x>/ imports registry (one-way, via init())
  • runner/catalog and runner/{console,headless} import registry

Anything that needs to know "which provider" must live above registry; the package itself is provider-agnostic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capabilities

func Capabilities(name string) []string

Capabilities returns a copy of the provider's declared capability list.

func DefaultConfig

func DefaultConfig(name string) (map[string]string, bool)

DefaultConfig builds a config map of option name -> default value.

func Names

func Names() []string

Names returns all registered provider names sorted alphabetically.

func OptionDescription

func OptionDescription(name string) string

OptionDescription returns the rendered description (with default / optional hints) for an option name aggregated across all registered providers, plus the two payload-level pseudo-options (payload, metadata). Returns "" when the option is unknown.

func OptionNames

func OptionNames() []string

OptionNames returns every option name known to the registry sorted alphabetically, including payload-level pseudo-options.

func Register

func Register(name string, spec Spec)

Register stores spec for the named provider. Re-registering the same name overwrites; intended to be called from init() so the order across providers does not matter.

func SensitiveOption

func SensitiveOption(name string) bool

SensitiveOption reports whether any registered provider marks this option name as sensitive (e.g. a secret that should not be logged or echoed).

func SupportsCapability

func SupportsCapability(provider, capability string) bool

SupportsCapability reports whether the named provider declares the given capability.

Types

type Option

type Option struct {
	Name        string
	Description string
	Default     string
	Required    bool
	Sensitive   bool
}

Option describes one provider configuration field (e.g. accesskey, region).

func Options

func Options(name string) []Option

Options returns a copy of the provider's option list.

type Spec

type Spec struct {
	Options      []Option
	Regions      []Suggestion
	Capabilities []string
}

Spec is the full self-description of a provider: its config options, region suggestions, and the capability identifiers it claims to support. Capability strings line up with runner/catalog payload capabilities ("cloudlist" / "iam" / "bucket" / "event" / "vm" / "database").

func Lookup

func Lookup(name string) (Spec, bool)

Lookup returns the spec for name if registered.

type Suggestion

type Suggestion struct {
	Text        string
	Description string
}

Suggestion is a single autocomplete entry (text + helper description) used for region pickers and similar UI surfaces.

func Regions

func Regions(name string) []Suggestion

Regions returns a copy of the provider's region suggestions.

Jump to

Keyboard shortcuts

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