plugins

package
v0.0.0-...-a1f8bd1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyzerPlugin

type AnalyzerPlugin interface {
	Plugin

	// AnalyzeProject performs custom project analysis
	AnalyzeProject(ctx context.Context, projectPath string) (*analysis.ProjectAnalysis, error)

	// GetSupportedLanguages returns languages this analyzer supports
	GetSupportedLanguages() []string

	// GetConfidenceScore returns how confident this analyzer is for a project
	GetConfidenceScore(ctx context.Context, projectPath string) (float64, error)
}

AnalyzerPlugin extends Plugin for project analysis capabilities

type GeneratorPlugin

type GeneratorPlugin interface {
	Plugin

	// GenerateFile creates a file based on analysis and templates
	GenerateFile(ctx context.Context, analysis *analysis.ProjectAnalysis, template string) (string, error)

	// GetSupportedTemplates returns templates this generator supports
	GetSupportedTemplates() []string

	// ValidateTemplate checks if a template is valid
	ValidateTemplate(ctx context.Context, template string) error
}

GeneratorPlugin extends Plugin for file generation capabilities

type IntegrationPlugin

type IntegrationPlugin interface {
	Plugin

	// GetServiceName returns the integrated service name
	GetServiceName() string

	// TestConnection verifies connectivity to the external service
	TestConnection(ctx context.Context) error

	// GetCapabilities returns what this integration can do
	GetCapabilities() []string
}

IntegrationPlugin extends Plugin for external service integrations

type Plugin

type Plugin interface {
	// GetInfo returns plugin metadata
	GetInfo() PluginInfo

	// Initialize prepares the plugin for use
	Initialize(ctx context.Context, config map[string]string) error

	// Shutdown cleans up plugin resources
	Shutdown(ctx context.Context) error

	// IsHealthy checks if the plugin is functioning correctly
	IsHealthy(ctx context.Context) error
}

Plugin defines the interface that all plugins must implement

type PluginInfo

type PluginInfo struct {
	ID          string            `json:"id"`
	Name        string            `json:"name"`
	Version     string            `json:"version"`
	Type        PluginType        `json:"type"`
	Description string            `json:"description"`
	Author      string            `json:"author"`
	Tags        []string          `json:"tags"`
	Config      map[string]string `json:"config"`
	Enabled     bool              `json:"enabled"`
}

PluginInfo contains metadata about a plugin

type PluginType

type PluginType string

PluginType defines the type of plugin

const (
	PluginTypeAnalyzer    PluginType = "analyzer"
	PluginTypeGenerator   PluginType = "generator"
	PluginTypeProvider    PluginType = "provider"
	PluginTypeIntegration PluginType = "integration"
)

type ProviderPlugin

type ProviderPlugin interface {
	Plugin

	// GetProviderName returns the cloud provider name
	GetProviderName() string

	// GetSupportedResources returns available resources for this provider
	GetSupportedResources() []string

	// ValidateCredentials checks if provider credentials are valid
	ValidateCredentials(ctx context.Context) error
}

ProviderPlugin extends Plugin for cloud provider integrations

type Registry

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

Registry manages all registered plugins

func NewRegistry

func NewRegistry(logger logger.Logger) *Registry

NewRegistry creates a new plugin registry

func (*Registry) DisablePlugin

func (r *Registry) DisablePlugin(ctx context.Context, pluginID string) error

DisablePlugin disables a specific plugin

func (*Registry) EnablePlugin

func (r *Registry) EnablePlugin(ctx context.Context, pluginID string) error

EnablePlugin enables a specific plugin

func (*Registry) GetAllPlugins

func (r *Registry) GetAllPlugins() []Plugin

GetAllPlugins returns all registered plugins

func (*Registry) GetPlugin

func (r *Registry) GetPlugin(pluginID string) (Plugin, error)

GetPlugin retrieves a specific plugin

func (*Registry) GetPluginInfo

func (r *Registry) GetPluginInfo() []PluginInfo

GetPluginInfo returns information about all registered plugins

func (*Registry) GetPluginsByType

func (r *Registry) GetPluginsByType(pluginType PluginType) []Plugin

GetPluginsByType returns all plugins of a specific type

func (*Registry) HealthCheck

func (r *Registry) HealthCheck(ctx context.Context) map[string]error

HealthCheck checks the health of all plugins

func (*Registry) InitializeAll

func (r *Registry) InitializeAll(ctx context.Context) error

InitializeAll initializes all registered plugins

func (*Registry) Register

func (r *Registry) Register(ctx context.Context, plugin Plugin) error

Register adds a plugin to the registry

func (*Registry) ShutdownAll

func (r *Registry) ShutdownAll(ctx context.Context)

ShutdownAll shuts down all registered plugins

func (*Registry) Unregister

func (r *Registry) Unregister(pluginID string) error

Unregister removes a plugin from the registry

Jump to

Keyboard shortcuts

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