Documentation
¶
Overview ¶
Package extension registers extension contracts independently of package lifecycle code.
Index ¶
- Constants
- func CompileSchema(directory, path string) (*jsonschema.Schema, error)
- func ComponentModes(metadata map[string]any) ([]string, error)
- func IsComponent(capability string) bool
- func ValidateAuth(binding Binding) error
- func ValidateCommand(binding Binding) error
- func ValidateComponent(binding Binding) error
- type Activation
- type Binding
- type Descriptor
- type Registry
Constants ¶
const ( ComponentDiscovery = "component.discovery" ComponentValidation = "component.validation" ComponentPreparation = "component.preparation" ComponentState = "component.state" )
Variables ¶
This section is empty.
Functions ¶
func CompileSchema ¶
func CompileSchema(directory, path string) (*jsonschema.Schema, error)
CompileSchema resolves references only within the package; validation never fetches the network.
func ComponentModes ¶
ComponentModes returns the execution modes a configuration export declares. An export that declares none supports only the native mode.
func IsComponent ¶
IsComponent reports whether a capability supplies component configuration.
func ValidateAuth ¶
ValidateAuth verifies the package's configuration schema and credential declarations.
func ValidateCommand ¶
ValidateCommand checks command metadata without running its executable.
func ValidateComponent ¶
ValidateComponent checks configuration-provider metadata without starting code.
Types ¶
type Activation ¶
type Activation struct {
Binding
Package string
Executable string
Description *pluginv1.DescribeResponse
// Alias is the package's key under plugins.packages, used to name its configuration in errors.
Alias string
// Timeout bounds every call into the plugin; zero means no deadline.
Timeout time.Duration
// InteractionLimit bounds how long an interactive call may wait for the user on top of
// Timeout; zero means the runtime default.
InteractionLimit time.Duration
}
Activation binds a statically validated export to its verified native package.
type Descriptor ¶
type Descriptor struct {
Capability string
Path []string
Version uint32
Validate func(Binding) error
Activate func(context.Context, *Activation) error
Scaffold string
Test func(context.Context, Binding) error
}
Descriptor supplies extension-specific validation, activation, scaffolding, and conformance hooks. Discovery and installation use only static validation.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry owns descriptors for supported extension contracts.
func New ¶
func New() *Registry
New creates an empty descriptor registry for explicit startup composition.
func (*Registry) Discover ¶
Discover reads export selectors for catalog metadata without resolving schemas. Discovery never implies that a package is installable or trusted.
func (*Registry) Get ¶
func (r *Registry) Get(capability string) (Descriptor, bool)
Get returns a descriptor with an isolated metadata path.
func (*Registry) Register ¶
func (r *Registry) Register(descriptor Descriptor) error
Register adds a capability selector and rejects overlapping metadata paths.