plugins

package
v1.1.72 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package plugins owns the non-Agent plugin ProductCore actions, persistence orchestration, invocation validation, and Docker runner boundary.

Index

Constants

View Source
const (
	LegacyAgentPluginID = "io.dirextalk.agent"
	OpsPluginID         = "io.dirextalk.ops"

	StatusInstalled = "installed"
	StatusEnabled   = "enabled"
	StatusDisabled  = "disabled"
	StatusRemoved   = "uninstalled"
)

Variables

This section is empty.

Functions

func ActionAllowed

func ActionAllowed(entry dirextalkplugin.CatalogEntry, action string) bool

func ContainerName

func ContainerName(pluginID string) string

func FindOfficialPlugin

func FindOfficialPlugin(pluginID string) (dirextalkplugin.CatalogEntry, bool)

func ImageReference

func ImageReference(image, digest string) string

func OfficialImage

func OfficialImage(image string) bool

func RunnerEnabled

func RunnerEnabled(runner Runner) bool

func ValidateOfficialOperation

func ValidateOfficialOperation(op RunnerOperation) error

Types

type Config

type Config struct {
	Homeserver string
	Now        func() time.Time
	NewJobID   func() string
}

Config contains stable service inputs while plugin state remains Store-owned.

type DockerRunner

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

func (DockerRunner) ApplyPlugin

func (r DockerRunner) ApplyPlugin(ctx context.Context, op RunnerOperation) error

func (DockerRunner) InvokePlugin

func (r DockerRunner) InvokePlugin(ctx context.Context, req InvokeRequest) (map[string]any, error)

func (DockerRunner) PluginRunnerEnabled

func (DockerRunner) PluginRunnerEnabled() bool

func (DockerRunner) StreamPlugin

func (r DockerRunner) StreamPlugin(ctx context.Context, req InvokeRequest, emit func(StreamEvent) error) error

type InvokeRequest

type InvokeRequest struct {
	PluginID      string
	ContainerName string
	Action        string
	Params        map[string]any
}

type Module

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

func New

func New(store Store, runner Runner, cfg Config) *Module

func (*Module) CheckStore

func (m *Module) CheckStore(ctx context.Context) error

CheckStore preserves the persisted-service constructor's startup read check without rebuilding an in-memory shadow of durable plugin state.

func (*Module) Handlers

func (m *Module) Handlers() map[string]actionbase.Handler

Handlers returns the exact ProductCore action surface owned by the module.

func (*Module) PrepareStream

func (m *Module) PrepareStream(ctx context.Context, params map[string]any) (PreparedStream, *actionbase.Error)

func (*Module) RunStream

func (m *Module) RunStream(ctx context.Context, prepared PreparedStream, emit func(StreamEvent) error) error

type NoopRunner

type NoopRunner struct{}

func (NoopRunner) ApplyPlugin

func (NoopRunner) InvokePlugin

func (NoopRunner) InvokePlugin(context.Context, InvokeRequest) (map[string]any, error)

func (NoopRunner) PluginRunnerEnabled

func (NoopRunner) PluginRunnerEnabled() bool

func (NoopRunner) StreamPlugin

type PreparedStream

type PreparedStream struct {
	PluginID string
	Action   string
	// contains filtered or unexported fields
}

PreparedStream is validated synchronously before the WS adapter starts a goroutine. The runner request stays opaque so callers cannot bypass module validation while retaining the existing frame metadata.

type Runner

type Runner interface {
	ApplyPlugin(context.Context, RunnerOperation) error
	InvokePlugin(context.Context, InvokeRequest) (map[string]any, error)
	StreamPlugin(context.Context, InvokeRequest, func(StreamEvent) error) error
}

func NewDockerRunner

func NewDockerRunner(binary, network string, client *http.Client) Runner

func NewEnvironmentRunner

func NewEnvironmentRunner() Runner

type RunnerOperation

type RunnerOperation struct {
	Action        string
	PluginID      string
	Name          string
	Version       string
	Image         string
	Digest        string
	ContainerName string
	Network       string
	Config        map[string]any
	Env           map[string]string
	Volumes       []string
}

type Store

Store is the durable plugin repository used by Module.

type StreamEvent

type StreamEvent struct {
	Event string
	Data  map[string]any
}

Jump to

Keyboard shortcuts

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