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, _ target.OutputFunc) (target.ApplyResult, error)
- func (m *Plugin) Check(ctx context.Context, params map[string]any, _ target.OutputFunc) (target.CheckResult, error)
- func (m *Plugin) CloneModule() target.Module
- 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. Each Plugin owns at most one live client at a time; the client is lazily created on first Check or Apply and reused across calls until reset or Close.
Plugin satisfies target.PluggableModule: LocalTarget clones it per-instance so each target keeps its own plugin client, and other transports use the interface to report a friendlier "use local or a staged bundle" error when a plugin is invoked over a transport that cannot delegate.
func (*Plugin) Apply ¶
func (m *Plugin) Apply(ctx context.Context, params map[string]any, _ target.OutputFunc) (target.ApplyResult, error)
func (*Plugin) Check ¶
func (m *Plugin) Check(ctx context.Context, params map[string]any, _ target.OutputFunc) (target.CheckResult, error)
func (*Plugin) CloneModule ¶
CloneModule returns a fresh Plugin sharing the same name, path, and factory but no live client. Used by LocalTarget so each target instance gets its own plugin subprocess state.
func (*Plugin) PluginPath ¶
PluginPath returns the filesystem path to the backing plugin executable.