plugin

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package plugin is the adapter registry. An adapter registers a factory for one kind from its package init; a binary picks its adapters by importing their packages (adapters/all brings every bundled one).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Implements

func Implements(kind core.Kind, v any) bool

func Register

func Register(kind core.Kind, typ, description string, f Factory)

Types

type Adapter

type Adapter struct {
	Kind        core.Kind
	Type        string
	Description string
	New         Factory
}

func List

func List() []Adapter

func New

func New(env core.Env, c *spec.Component) (any, Adapter, error)

New builds a component and checks it implements its kind's interface.

func Resolve

func Resolve(c *spec.Component) (Adapter, error)

Resolve finds the adapter for a component; kind may be omitted when the type is unique across kinds.

type Factory

type Factory func(env core.Env, c *spec.Component) (any, error)

Jump to

Keyboard shortcuts

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