Documentation
¶
Overview ¶
Package plugins owns the non-Agent plugin ProductCore actions, persistence orchestration, invocation validation, and Docker runner boundary.
Index ¶
- Constants
- func ActionAllowed(entry dirextalkplugin.CatalogEntry, action string) bool
- func ContainerName(pluginID string) string
- func FindOfficialPlugin(pluginID string) (dirextalkplugin.CatalogEntry, bool)
- func ImageReference(image, digest string) string
- func NormalizeInstance(plugin dirextalkplugin.Instance) dirextalkplugin.Instance
- func OfficialImage(image string) bool
- func RunnerEnabled(runner Runner) bool
- func ValidateOfficialOperation(op RunnerOperation) error
- type Config
- type DockerRunner
- func (r DockerRunner) ApplyPlugin(ctx context.Context, op RunnerOperation) error
- func (r DockerRunner) InvokePlugin(ctx context.Context, req InvokeRequest) (map[string]any, error)
- func (DockerRunner) PluginRunnerEnabled() bool
- func (r DockerRunner) StreamPlugin(ctx context.Context, req InvokeRequest, emit func(StreamEvent) error) error
- type InvokeRequest
- type Module
- func (m *Module) CheckStore(ctx context.Context) error
- func (m *Module) Handlers() map[string]actionbase.Handler
- func (m *Module) PrepareStream(ctx context.Context, params map[string]any) (PreparedStream, *actionbase.Error)
- func (m *Module) RunStream(ctx context.Context, prepared PreparedStream, emit func(StreamEvent) error) error
- type NoopRunner
- type PreparedStream
- type Runner
- type RunnerOperation
- type Store
- type StreamEvent
Constants ¶
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 FindOfficialPlugin ¶
func FindOfficialPlugin(pluginID string) (dirextalkplugin.CatalogEntry, bool)
func ImageReference ¶
func NormalizeInstance ¶
func NormalizeInstance(plugin dirextalkplugin.Instance) dirextalkplugin.Instance
func OfficialImage ¶
func RunnerEnabled ¶
func ValidateOfficialOperation ¶
func ValidateOfficialOperation(op RunnerOperation) error
Types ¶
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 Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) CheckStore ¶
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) ApplyPlugin(context.Context, RunnerOperation) error
func (NoopRunner) InvokePlugin ¶
func (NoopRunner) InvokePlugin(context.Context, InvokeRequest) (map[string]any, error)
func (NoopRunner) PluginRunnerEnabled ¶
func (NoopRunner) PluginRunnerEnabled() bool
func (NoopRunner) StreamPlugin ¶
func (NoopRunner) StreamPlugin(context.Context, InvokeRequest, func(StreamEvent) error) error
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 NewEnvironmentRunner ¶
func NewEnvironmentRunner() Runner
type RunnerOperation ¶
type Store ¶
type Store interface {
UpsertPlugin(context.Context, dirextalkplugin.Instance) error
ListPlugins(context.Context) ([]dirextalkplugin.Instance, error)
GetPlugin(context.Context, string) (dirextalkplugin.Instance, bool, error)
UpsertPluginJob(context.Context, dirextalkplugin.Job) error
GetPluginJob(context.Context, string) (dirextalkplugin.Job, bool, error)
UpsertPluginSecret(context.Context, dirextalkplugin.Secret) error
GetPluginSecret(context.Context, string, string) (dirextalkplugin.Secret, bool, error)
}
Store is the durable plugin repository used by Module.