plugins

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIPlugin

type APIPlugin interface {
	EnterprisePlugin

	// RegisterRoutes adds plugin-specific API endpoints
	// Returns a map of route path -> handler
	RegisterRoutes() map[string]any
}

APIPlugin extends EnterprisePlugin for API-related features

type BackupInfo

type BackupInfo struct {
	ID        string
	Timestamp int64
	Size      int64
	Location  string
	Metadata  map[string]string
}

BackupInfo contains metadata about a backup

type BackupPlugin

type BackupPlugin interface {
	EnterprisePlugin

	// Backup performs a backup operation
	Backup(ctx context.Context, destination string) error

	// Restore performs a restore operation
	Restore(ctx context.Context, source string) error

	// ListBackups returns available backups
	ListBackups(ctx context.Context) ([]BackupInfo, error)
}

BackupPlugin extends EnterprisePlugin for backup features

type EnterprisePlugin

type EnterprisePlugin interface {
	// Name returns the plugin name (e.g., "cloudflare-vectorize", "r2-backup")
	Name() string

	// Version returns the plugin version
	Version() string

	// RequiredFeatures returns the edition features this plugin requires
	RequiredFeatures() []string

	// Initialize is called when the plugin is loaded
	// The license parameter contains the validated Enterprise license
	Initialize(ctx context.Context, license *licensing.License, config map[string]any) error

	// Start begins plugin operation (called after all plugins are initialized)
	Start(ctx context.Context) error

	// Stop gracefully shuts down the plugin
	Stop(ctx context.Context) error

	// HealthCheck returns the plugin's health status
	HealthCheck(ctx context.Context) error
}

EnterprisePlugin defines the interface for Enterprise feature plugins These plugins are loaded only when running Enterprise edition with valid license

type MonitoringPlugin

type MonitoringPlugin interface {
	EnterprisePlugin

	// GetMetrics returns plugin-specific metrics
	GetMetrics(ctx context.Context) (map[string]any, error)
}

MonitoringPlugin extends EnterprisePlugin for monitoring features

type PluginLoader

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

PluginLoader manages Enterprise plugin loading and lifecycle

func NewPluginLoader

func NewPluginLoader(license *licensing.License, logger *slog.Logger) *PluginLoader

NewPluginLoader creates a new plugin loader

func (*PluginLoader) GetAllPlugins

func (l *PluginLoader) GetAllPlugins() []EnterprisePlugin

GetAllPlugins returns all loaded plugins

func (*PluginLoader) GetPlugin

func (l *PluginLoader) GetPlugin(name string) (EnterprisePlugin, bool)

GetPlugin returns a plugin by name

func (*PluginLoader) HealthCheckAll

func (l *PluginLoader) HealthCheckAll(ctx context.Context) map[string]error

HealthCheckAll runs health checks on all plugins

func (*PluginLoader) LoadPluginsFromDir

func (l *PluginLoader) LoadPluginsFromDir(ctx context.Context, dir string) error

LoadPluginsFromDir loads all plugins from a directory Plugins should be .so files (Go plugins)

func (*PluginLoader) StartAll

func (l *PluginLoader) StartAll(ctx context.Context) error

StartAll starts all loaded plugins

func (*PluginLoader) StopAll

func (l *PluginLoader) StopAll(ctx context.Context) error

StopAll stops all loaded plugins

type PluginMetadata

type PluginMetadata struct {
	Name             string
	Version          string
	Description      string
	Author           string
	License          string
	RequiredFeatures []string
	RequiredVersion  string // Minimum GraphDB version required
}

PluginMetadata contains plugin information

type StoragePlugin

type StoragePlugin interface {
	EnterprisePlugin

	// AttachToStorage integrates the plugin with the graph storage
	AttachToStorage(storage *storage.GraphStorage) error
}

StoragePlugin extends EnterprisePlugin for storage-related features

Jump to

Keyboard shortcuts

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