Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type Event
- type EventBus
- type EventHandler
- type LinuxSandbox
- type Manager
- func (m *Manager) CheckForUpdates(repo *PluginRepository) ([]string, error)
- func (m *Manager) DeployRepository(repo *PluginRepository, localPath string) error
- func (m *Manager) DisablePlugin(name string) error
- func (m *Manager) DiscoverPlugins(dir string) error
- func (m *Manager) EnablePlugin(name string) error
- func (m *Manager) ExecutePlugin(name string) error
- func (m *Manager) GetPluginStats(name string) (*PluginStats, error)
- func (m *Manager) HotReload(name string, path string) error
- func (m *Manager) ListPlugins() []string
- func (m *Manager) LoadEnabledPlugins(pluginDir string) error
- func (m *Manager) LoadPlugin(path string) error
- func (m *Manager) SetupRemoteRepository(url, sshKeyPath string) (*PluginRepository, error)
- func (m *Manager) SubscribeToEvent(eventName string, handler EventHandler)
- func (m *Manager) UnloadPlugin(name string) error
- func (m *Manager) UpdatePlugin(repo *PluginRepository, pluginName string) error
- func (m *Manager) VerifyPluginSignature(pluginPath string, publicKeyPath string) error
- type Plugin
- type PluginError
- type PluginHotReloadedEvent
- type PluginLoadedEvent
- type PluginMetadata
- type PluginRepository
- type PluginStats
- type PluginUnloadedEvent
- type Sandbox
Constants ¶
View Source
const PluginSymbol = "Plugin"
Variables ¶
View Source
var ( ErrPluginAlreadyLoaded = errors.New("plugin already loaded") ErrInvalidPluginInterface = errors.New("invalid plugin interface") ErrPluginNotFound = errors.New("plugin not found") ErrIncompatibleVersion = errors.New("incompatible plugin version") ErrMissingDependency = errors.New("missing plugin dependency") ErrCircularDependency = errors.New("circular plugin dependency detected") ErrPluginSandboxViolation = errors.New("plugin attempted to violate sandbox") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Enabled map[string]bool `json:"enabled"`
// contains filtered or unexported fields
}
func LoadConfig ¶
func (*Config) DisablePlugin ¶
func (*Config) EnablePlugin ¶
func (*Config) EnabledPlugins ¶
type EventBus ¶
type EventBus struct {
// contains filtered or unexported fields
}
func NewEventBus ¶
func NewEventBus() *EventBus
func (*EventBus) Subscribe ¶
func (eb *EventBus) Subscribe(eventName string, handler EventHandler)
type EventHandler ¶
type EventHandler func(Event)
type LinuxSandbox ¶
type LinuxSandbox struct {
// contains filtered or unexported fields
}
func NewLinuxSandbox ¶
func NewLinuxSandbox(chrootDir string) *LinuxSandbox
func (*LinuxSandbox) Disable ¶
func (s *LinuxSandbox) Disable() error
func (*LinuxSandbox) Enable ¶
func (s *LinuxSandbox) Enable() error
func (*LinuxSandbox) VerifyPluginPath ¶
func (s *LinuxSandbox) VerifyPluginPath(path string) error
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CheckForUpdates ¶
func (m *Manager) CheckForUpdates(repo *PluginRepository) ([]string, error)
func (*Manager) DeployRepository ¶
func (m *Manager) DeployRepository(repo *PluginRepository, localPath string) error
func (*Manager) DisablePlugin ¶
func (*Manager) DiscoverPlugins ¶
func (*Manager) EnablePlugin ¶
func (*Manager) ExecutePlugin ¶
func (*Manager) GetPluginStats ¶
func (m *Manager) GetPluginStats(name string) (*PluginStats, error)
func (*Manager) ListPlugins ¶
func (*Manager) LoadEnabledPlugins ¶
func (*Manager) LoadPlugin ¶
func (*Manager) SetupRemoteRepository ¶
func (m *Manager) SetupRemoteRepository(url, sshKeyPath string) (*PluginRepository, error)
func (*Manager) SubscribeToEvent ¶
func (m *Manager) SubscribeToEvent(eventName string, handler EventHandler)
func (*Manager) UnloadPlugin ¶
func (*Manager) UpdatePlugin ¶
func (m *Manager) UpdatePlugin(repo *PluginRepository, pluginName string) error
type Plugin ¶
type Plugin interface {
Metadata() PluginMetadata
PreLoad() error
Init() error
PostLoad() error
Execute() error
PreUnload() error
Shutdown() error
}
func LoadPlugin ¶
type PluginError ¶
func (*PluginError) Error ¶
func (e *PluginError) Error() string
func (*PluginError) Unwrap ¶
func (e *PluginError) Unwrap() error
type PluginHotReloadedEvent ¶
type PluginHotReloadedEvent struct {
PluginName string
}
func (PluginHotReloadedEvent) Name ¶
func (e PluginHotReloadedEvent) Name() string
type PluginLoadedEvent ¶
type PluginLoadedEvent struct {
PluginName string
}
func (PluginLoadedEvent) Name ¶
func (e PluginLoadedEvent) Name() string
type PluginMetadata ¶
type PluginRepository ¶
type PluginStats ¶
type PluginUnloadedEvent ¶
type PluginUnloadedEvent struct {
PluginName string
}
func (PluginUnloadedEvent) Name ¶
func (e PluginUnloadedEvent) Name() string
Click to show internal directories.
Click to hide internal directories.
An efficient and straightforward way to deploy and manage remote plugin repositories.