extensions

package
v0.0.0-...-ec9e501 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: MIT, MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckDependencies

func CheckDependencies(name string) error

CheckDependencies checks if all dependencies are satisfied

func DisableExtension

func DisableExtension(name string) error

DisableExtension disables an extension

func EnableExtension

func EnableExtension(name string) error

EnableExtension enables an extension

func GetExtensionStatus

func GetExtensionStatus() map[string]string

GetExtensionStatus returns the status of all extensions

func InitExtensionManager

func InitExtensionManager() error

InitExtensionManager initializes the extension manager

func InstallExtension

func InstallExtension(name string) error

InstallExtension installs a new extension

func StartExtension

func StartExtension(name string) error

StartExtension starts an extension

func StopExtension

func StopExtension(name string) error

StopExtension stops an extension

func UninstallExtension

func UninstallExtension(name string) error

UninstallExtension removes an installed extension

Types

type BaseExtension

type BaseExtension struct {
	Name        string
	Version     string
	Description string
}

BaseExtension provides common fields for extensions. It is intended to be embedded in specific extension types.

type Extension

type Extension struct {
	Name         string
	Version      string
	Description  string
	Plugin       *plugin.Plugin
	Enabled      bool
	Interface    ExtensionInterface
	Dependencies []string
	Status       string
	// contains filtered or unexported fields
}

Extension represents a loaded extension

func GetExtension

func GetExtension(name string) (*Extension, error)

GetExtension returns an extension by name

func ListExtensions

func ListExtensions() ([]*Extension, error)

ListExtensions returns all available extensions

type ExtensionHealth

type ExtensionHealth struct {
	LastHeartbeat time.Time
	Status        string
	Error         error
	// contains filtered or unexported fields
}

ExtensionHealth tracks extension process health

type ExtensionInterface

type ExtensionInterface interface {
	Start() error
	Stop() error
	Status() string
	IsRunning() bool
	Name() string
	Version() string
	Dependencies() []string
}

ExtensionInterface defines the interface that all extensions must implement

type Manager

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

Manager handles the loading and management of extensions

type PluginHealth

type PluginHealth struct {
	LastHeartbeat time.Time
	Status        string
	Error         error
	// contains filtered or unexported fields
}

PluginHealth tracks plugin process health

type PythonExtension

type PythonExtension struct {
	BaseExtension
	// contains filtered or unexported fields
}

PythonExtension represents a Python-based extension

func NewPythonExtension

func NewPythonExtension(name, version, description, scriptPath string) *PythonExtension

NewPythonExtension creates a new Python extension

func (*PythonExtension) ExecuteFunction

func (e *PythonExtension) ExecuteFunction(name string, args ...interface{}) (interface{}, error)

ExecuteFunction calls a Python function with arguments

func (*PythonExtension) IsRunning

func (e *PythonExtension) IsRunning() bool

IsRunning checks if the extension process is running

func (*PythonExtension) ReceiveMessage

func (e *PythonExtension) ReceiveMessage() (interface{}, error)

ReceiveMessage receives a message from the Python process

func (*PythonExtension) SendMessage

func (e *PythonExtension) SendMessage(msg interface{}) error

SendMessage sends a message to the Python process

func (*PythonExtension) Start

func (e *PythonExtension) Start() error

Start initializes and starts the Python extension

func (*PythonExtension) Status

func (e *PythonExtension) Status() string

Status returns the current status of the extension

func (*PythonExtension) Stop

func (e *PythonExtension) Stop() error

Stop gracefully stops the Python extension

type PythonManager

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

PythonManager handles Python extension management

func NewPythonManager

func NewPythonManager(pluginsDir string) (*PythonManager, error)

NewPythonManager creates a new Python extension manager

func (*PythonManager) DisablePlugin

func (m *PythonManager) DisablePlugin(name string) error

DisablePlugin disables a Python extension plugin

func (*PythonManager) EnablePlugin

func (m *PythonManager) EnablePlugin(name string) error

EnablePlugin enables a Python extension plugin

func (*PythonManager) ExecutePlugin

func (m *PythonManager) ExecutePlugin(ctx context.Context, name string, data interface{}) (interface{}, error)

ExecutePlugin executes a Python plugin with data exchange

func (*PythonManager) InstallPlugin

func (m *PythonManager) InstallPlugin(name, source string) error

InstallPlugin installs a Python extension plugin

func (*PythonManager) ListPlugins

func (m *PythonManager) ListPlugins() ([]*PythonPlugin, error)

ListPlugins lists all installed Python plugins

func (*PythonManager) LoadPlugin

func (m *PythonManager) LoadPlugin(name string) (*PythonPlugin, error)

LoadPlugin loads a Python extension plugin

func (*PythonManager) StartPlugin

func (m *PythonManager) StartPlugin(name string) error

StartPlugin starts a Python plugin with IPC

func (*PythonManager) StopPlugin

func (m *PythonManager) StopPlugin(name string) error

StopPlugin stops a running Python plugin

func (*PythonManager) UninstallPlugin

func (m *PythonManager) UninstallPlugin(name string) error

UninstallPlugin uninstalls a Python extension plugin

type PythonPlugin

type PythonPlugin struct {
	Name         string
	Version      string
	Description  string
	EntryPoint   string
	Requirements []string
	Enabled      bool
	Process      *exec.Cmd
	Socket       net.Conn
	Health       *PluginHealth
}

PythonPlugin represents a Python-based extension plugin

Jump to

Keyboard shortcuts

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