manager

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 50 Imported by: 0

Documentation

Overview

Package manager provides plugin management with configuration support.

Index

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.

func (*Builder) Build

func (b *Builder) Build() *Manager

Build constructs the Manager with the configured settings.

func (*Builder) WithCustomRegistries

func (b *Builder) WithCustomRegistries(inputReg *input.Registry, outputReg *output.Registry) *Builder

WithCustomRegistries allows providing custom plugin registries (useful for testing).

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

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) GetArgs

func (b *ExternalInputPlugin) GetArgs() map[string]any

GetArgs returns custom arguments for this plugin.

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) SetArgs

func (b *ExternalInputPlugin) SetArgs(args map[string]any)

SetArgs sets custom arguments for this plugin.

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

func (p *ExternalOutputPlugin) Generate(themeData *colour.ThemeData) (map[string][]byte, error)

Generate executes the external plugin and returns its output.

func (*ExternalOutputPlugin) GetArgs

func (b *ExternalOutputPlugin) GetArgs() map[string]any

GetArgs returns custom arguments for this plugin.

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) SetArgs

func (b *ExternalOutputPlugin) SetArgs(args map[string]any)

SetArgs sets custom arguments for this plugin.

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.

func (*ExternalOutputPlugin) Version

func (b *ExternalOutputPlugin) Version() string

Version returns the plugin's version by querying the plugin executable.

type Manager

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

Manager owns plugin registries and provides plugin lookup.

func (*Manager) AllInputPlugins

func (m *Manager) AllInputPlugins() map[string]input.Plugin

AllInputPlugins returns all registered input plugins.

func (*Manager) AllOutputPlugins

func (m *Manager) AllOutputPlugins() map[string]output.Plugin

AllOutputPlugins returns all registered output plugins.

func (*Manager) GetInputPlugin

func (m *Manager) GetInputPlugin(name string) (input.Plugin, bool)

GetInputPlugin retrieves an input plugin by name.

func (*Manager) GetOutputPlugin

func (m *Manager) GetOutputPlugin(name string) (output.Plugin, bool)

GetOutputPlugin retrieves an output plugin by name.

func (*Manager) InputRegistry

func (m *Manager) InputRegistry() *input.Registry

InputRegistry returns the input plugin registry.

func (*Manager) OutputRegistry

func (m *Manager) OutputRegistry() *output.Registry

OutputRegistry returns the output plugin registry.

func (*Manager) RegisterExternalPlugin

func (m *Manager) RegisterExternalPlugin(name, pluginType, path, description string) error

RegisterExternalPlugin registers an external plugin with the manager.

type PluginInfo

type PluginInfo struct {
	Name            string `json:"name"`
	Type            string `json:"type"`
	Version         string `json:"version"`
	ProtocolVersion string `json:"protocol_version"`
	Description     string `json:"description"`
}

PluginInfo holds metadata returned by a plugin's --plugin-info command.

Jump to

Keyboard shortcuts

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