extension

package
v1.234.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package extension registers extension contracts independently of package lifecycle code.

Index

Constants

This section is empty.

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 ValidateAuth

func ValidateAuth(binding Binding) error

ValidateAuth verifies the package's configuration schema and credential declarations.

func ValidateCommand

func ValidateCommand(binding Binding) error

ValidateCommand checks command metadata without running its executable.

Types

type Activation

type Activation struct {
	Binding
	Package     string
	Executable  string
	Description *pluginv1.DescribeResponse
	// Timeout bounds every call into the plugin; zero means no deadline.
	Timeout time.Duration
}

Activation binds a statically validated export to its verified native package.

type Binding

type Binding struct {
	Capability string
	Name       string
	Directory  string
	Metadata   map[string]any
}

Binding describes one statically validated export in an installed 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

func (r *Registry) Discover(capabilities map[string]any) ([]Binding, error)

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.

func (*Registry) Validate

func (r *Registry) Validate(directory string, capabilities map[string]any) ([]Binding, error)

Validate discovers every declared export and rejects unsupported metadata. A package is accepted as a whole before any adapter is activated.

Jump to

Keyboard shortcuts

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