plugin

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrBadEntry = err.Const("bad plugin entry point")
	ErrNoSymbol = err.Const("no symbol found")
)
View Source
const ErrRebuild = err.Const("plugin may need to be rebuilt")

Variables

This section is empty.

Functions

func Load

func Load[T any](ctx context.Context, plugs []*Plugin, cst Constructor) ([]T, error)

Load helps load types from a plugin. If cst == UIs, T must be ui.NamedConstructor. Otherwise, the types loaded from the plugin will be filtered down to only types which successfully type-assert to T.

Types

type Constructor

type Constructor string

Constructor is a supported constructor type. Callers should pass in one of the Constructor constants, so we know which constructor to look up in the plugin files.

const (
	Actions Constructor = "Actions"
	UIs     Constructor = "UIs"
)

type Globber

type Globber interface {
	Glob(context.Context, string) []string
}

Globber is a type which can glob files.

type LazyConfig

type LazyConfig struct {
	// contains filtered or unexported fields
}

func (*LazyConfig) UnmarshalConfig

func (l *LazyConfig) UnmarshalConfig(ctx context.Context, decode func(any) error)

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin is a type which can open plugin files and look up functions and types within those files.

func All

func All(ctx context.Context, dir string, configure pref.Configure) ([]*Plugin, error)

func (*Plugin) Module

func (p *Plugin) Module() (mod, version string)

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Path

func (p *Plugin) Path() string

Jump to

Keyboard shortcuts

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