Documentation
¶
Overview ¶
Package manager provides plugin management with configuration support.
Index ¶
- type Builder
- type ExternalInputPlugin
- func (b *ExternalInputPlugin) Description() string
- func (p *ExternalInputPlugin) Generate(ctx context.Context, opts input.GenerateOptions) (*colour.Palette, error)
- func (b *ExternalInputPlugin) GetArgs() map[string]any
- func (b *ExternalInputPlugin) GetDryRun() bool
- func (p *ExternalInputPlugin) GetFlagHelp() []input.FlagHelp
- func (b *ExternalInputPlugin) Name() string
- func (p *ExternalInputPlugin) RegisterFlags(_ *cobra.Command)
- func (b *ExternalInputPlugin) SetArgs(args map[string]any)
- func (b *ExternalInputPlugin) SetDryRun(dryRun bool)
- func (p *ExternalInputPlugin) Validate() error
- func (b *ExternalInputPlugin) Version() string
- func (p *ExternalInputPlugin) WallpaperPath() string
- func (p *ExternalInputPlugin) WallpaperRawPath() string
- type ExternalOutputPlugin
- func (p *ExternalOutputPlugin) DefaultOutputDir() string
- func (b *ExternalOutputPlugin) Description() string
- func (p *ExternalOutputPlugin) Generate(themeData *colour.ThemeData) (map[string][]byte, error)
- func (b *ExternalOutputPlugin) GetArgs() map[string]any
- func (b *ExternalOutputPlugin) GetDryRun() bool
- func (p *ExternalOutputPlugin) GetFlagHelp() []input.FlagHelp
- func (p *ExternalOutputPlugin) GetVerbose() bool
- func (b *ExternalOutputPlugin) Name() string
- func (p *ExternalOutputPlugin) PostExecute(ctx context.Context, writtenFiles []string) error
- func (p *ExternalOutputPlugin) PreExecute(ctx context.Context) (skip bool, reason string, err error)
- func (p *ExternalOutputPlugin) RegisterFlags(_ *cobra.Command)
- func (p *ExternalOutputPlugin) SetAlternatePalette(palette *colour.CategorisedPalette)
- func (b *ExternalOutputPlugin) SetArgs(args map[string]any)
- func (b *ExternalOutputPlugin) SetDryRun(dryRun bool)
- func (p *ExternalOutputPlugin) SetVerbose(verbose bool)
- func (p *ExternalOutputPlugin) Validate() error
- func (b *ExternalOutputPlugin) Version() string
- type Manager
- func (m *Manager) AllInputPlugins() map[string]input.Plugin
- func (m *Manager) AllOutputPlugins() map[string]output.Plugin
- func (m *Manager) GetInputPlugin(name string) (input.Plugin, bool)
- func (m *Manager) GetOutputPlugin(name string) (output.Plugin, bool)
- func (m *Manager) InputRegistry() *input.Registry
- func (m *Manager) OutputRegistry() *output.Registry
- func (m *Manager) RegisterExternalPlugin(name, pluginType, path, description string) error
- type PluginInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder provides a fluent interface for constructing a Manager.
func NewBuilder ¶
func NewBuilder() *Builder
NewBuilder creates a new Manager builder with default settings.
type ExternalInputPlugin ¶
type ExternalInputPlugin struct {
// contains filtered or unexported fields
}
ExternalInputPlugin wraps an external executable as an input plugin.
func NewExternalInputPlugin ¶
func NewExternalInputPlugin(name, description, path string) *ExternalInputPlugin
NewExternalInputPlugin creates a new external input plugin wrapper.
func (*ExternalInputPlugin) Description ¶
func (b *ExternalInputPlugin) Description() string
Description returns the plugin's description.
func (*ExternalInputPlugin) Generate ¶
func (p *ExternalInputPlugin) Generate(ctx context.Context, opts input.GenerateOptions) (*colour.Palette, error)
Generate executes the external plugin and returns a palette. Uses the hybrid executor which automatically detects and uses the appropriate protocol (go-plugin RPC or JSON-stdio).
func (*ExternalInputPlugin) GetDryRun ¶
func (b *ExternalInputPlugin) GetDryRun() bool
GetDryRun returns the dry-run mode for this plugin.
func (*ExternalInputPlugin) GetFlagHelp ¶
func (p *ExternalInputPlugin) GetFlagHelp() []input.FlagHelp
GetFlagHelp returns help information for plugin flags. For external plugins, this queries the plugin executable via RPC.
func (*ExternalInputPlugin) Name ¶
func (b *ExternalInputPlugin) Name() string
Name returns the plugin's name.
func (*ExternalInputPlugin) RegisterFlags ¶
func (p *ExternalInputPlugin) RegisterFlags(_ *cobra.Command)
RegisterFlags is a no-op for external plugins (they don't have flags).
func (*ExternalInputPlugin) SetDryRun ¶
func (b *ExternalInputPlugin) SetDryRun(dryRun bool)
SetDryRun sets the dry-run mode for this plugin.
func (*ExternalInputPlugin) Validate ¶
func (p *ExternalInputPlugin) Validate() error
Validate checks if the plugin is valid.
func (*ExternalInputPlugin) Version ¶
func (b *ExternalInputPlugin) Version() string
Version returns the plugin's version by querying the plugin executable.
func (*ExternalInputPlugin) WallpaperPath ¶
func (p *ExternalInputPlugin) WallpaperPath() string
WallpaperPath returns the canonical wallpaper path from the last plugin execution. Implements the input.WallpaperProvider interface for external plugins.
func (*ExternalInputPlugin) WallpaperRawPath ¶ added in v0.1.22
func (p *ExternalInputPlugin) WallpaperRawPath() string
WallpaperRawPath returns the raw wallpaper path from the last plugin execution. This is the literal path as provided by the user before any canonicalization. Implements the input.WallpaperProvider interface for external plugins.
type ExternalOutputPlugin ¶
type ExternalOutputPlugin struct {
// contains filtered or unexported fields
}
ExternalOutputPlugin wraps an external executable as an output plugin.
func NewExternalOutputPlugin ¶
func NewExternalOutputPlugin(name, description, path string) *ExternalOutputPlugin
NewExternalOutputPlugin creates a new external output plugin wrapper.
func (*ExternalOutputPlugin) DefaultOutputDir ¶
func (p *ExternalOutputPlugin) DefaultOutputDir() string
DefaultOutputDir returns the default output directory (not used for external plugins).
func (*ExternalOutputPlugin) Description ¶
func (b *ExternalOutputPlugin) Description() string
Description returns the plugin's description.
func (*ExternalOutputPlugin) Generate ¶
Generate executes the external plugin and returns its output.
func (*ExternalOutputPlugin) GetDryRun ¶
func (b *ExternalOutputPlugin) GetDryRun() bool
GetDryRun returns the dry-run mode for this plugin.
func (*ExternalOutputPlugin) GetFlagHelp ¶
func (p *ExternalOutputPlugin) GetFlagHelp() []input.FlagHelp
GetFlagHelp returns help information for plugin flags. For external plugins, this queries the plugin executable via RPC.
func (*ExternalOutputPlugin) GetVerbose ¶
func (p *ExternalOutputPlugin) GetVerbose() bool
GetVerbose returns the verbose setting for this plugin.
func (*ExternalOutputPlugin) Name ¶
func (b *ExternalOutputPlugin) Name() string
Name returns the plugin's name.
func (*ExternalOutputPlugin) PostExecute ¶
func (p *ExternalOutputPlugin) PostExecute(ctx context.Context, writtenFiles []string) error
PostExecute calls the external plugin's post-execute hook. Implements the output.PostExecuteHook interface.
func (*ExternalOutputPlugin) PreExecute ¶
func (p *ExternalOutputPlugin) PreExecute(ctx context.Context) (skip bool, reason string, err error)
PreExecute calls the external plugin's pre-execute hook. Implements the output.PreExecuteHook interface.
func (*ExternalOutputPlugin) RegisterFlags ¶
func (p *ExternalOutputPlugin) RegisterFlags(_ *cobra.Command)
RegisterFlags is a no-op for external plugins (they don't have flags).
func (*ExternalOutputPlugin) SetAlternatePalette ¶ added in v0.1.0
func (p *ExternalOutputPlugin) SetAlternatePalette(palette *colour.CategorisedPalette)
SetAlternatePalette sets the alternate palette for dual-theme generation.
func (*ExternalOutputPlugin) SetDryRun ¶
func (b *ExternalOutputPlugin) SetDryRun(dryRun bool)
SetDryRun sets the dry-run mode for this plugin.
func (*ExternalOutputPlugin) SetVerbose ¶
func (p *ExternalOutputPlugin) SetVerbose(verbose bool)
SetVerbose sets the verbose flag for this plugin.
func (*ExternalOutputPlugin) Validate ¶
func (p *ExternalOutputPlugin) Validate() error
Validate checks if the plugin is valid.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager owns plugin registries and provides plugin lookup.
func (*Manager) AllInputPlugins ¶
AllInputPlugins returns all registered input plugins.
func (*Manager) AllOutputPlugins ¶
AllOutputPlugins returns all registered output plugins.
func (*Manager) GetInputPlugin ¶
GetInputPlugin retrieves an input plugin by name.
func (*Manager) GetOutputPlugin ¶
GetOutputPlugin retrieves an output plugin by name.
func (*Manager) InputRegistry ¶
InputRegistry returns the input plugin registry.
func (*Manager) OutputRegistry ¶
OutputRegistry returns the output plugin registry.
func (*Manager) RegisterExternalPlugin ¶
RegisterExternalPlugin registers an external plugin with the manager.