Documentation
¶
Index ¶
- func NewModule(name, path string) target.Module
- type LoadedPlugin
- type Options
- type Plugin
- func (m *Plugin) Apply(ctx context.Context, params map[string]any, out target.OutputFunc) (target.ApplyResult, error)
- func (m *Plugin) BindTarget(ops target.TargetOps) target.Module
- func (m *Plugin) Check(ctx context.Context, params map[string]any, out target.OutputFunc) (target.CheckResult, error)
- func (m *Plugin) Close() error
- func (m *Plugin) PluginPath() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LoadedPlugin ¶
LoadedPlugin is one plugin executable registered into the runtime module map.
func BuildRegistry ¶
func BuildRegistry(base target.ModuleRegistry, opts Options) (target.ModuleRegistry, []LoadedPlugin, error)
BuildRegistry merges built-in modules with discovered plugins. Plugin names may not shadow built-ins and duplicate plugin names are rejected.
type Options ¶
type Options struct {
BinaryDir string
WorkingDir string
PreferredDirs []string
ExclusivePreferredDirs bool
}
Options controls plugin discovery and registration.
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin adapts an executable plugin into target.Module. It is created unbound (path only) during BuildRegistry; a target binds it to its TargetOps backend via BindTarget. Once bound, the lazily-created client carries protocol_version and the enriched TargetInfo at initialize, and the plugin's handle-op requests (RunCommand/PutFile/GetFile) flow through the bound ops backend — including against the local target.
Plugin satisfies target.PluggableModule. It forwards Message and streams output (the silent drops of the v0 adapter are fixed): Check/Apply use the streaming SDK calls so plugin output notifications reach the runner.
func (*Plugin) Apply ¶
func (m *Plugin) Apply(ctx context.Context, params map[string]any, out target.OutputFunc) (target.ApplyResult, error)
func (*Plugin) BindTarget ¶
BindTarget returns a fresh Plugin bound to the given target ops backend. The returned Module owns its own (lazily-created) client state; the receiver stays unbound so another target can bind it independently.
func (*Plugin) Check ¶
func (m *Plugin) Check(ctx context.Context, params map[string]any, out target.OutputFunc) (target.CheckResult, error)
func (*Plugin) PluginPath ¶
PluginPath returns the filesystem path to the backing plugin executable.