Files
plugin-manager/errors.go
Matt Dunleavy eedbbfec4a Implement major enhancements to plugin manager (v1.2.0 & v1.3.0)
This commit introduces significant improvements and new features to the plugin manager:

- Add plugin discovery system and remote repository support
- Implement plugin update system with digital signature verification
- Enhance plugin lifecycle hooks (PreLoad, PostLoad, PreUnload)
- Improve dependency management with custom version comparison
- Introduce lazy loading for optimized plugin performance
- Implement comprehensive error handling and logging
- Enhance concurrency safety with fine-grained locking
- Add plugin statistics tracking
- Remove external version comparison dependencies
- Improve hot-reload functionality with graceful shutdown
- Add SSH key support for remote repositories
- Implement Redbean server integration for plugin repositories

This update significantly improves the plugin manager's functionality,
security, and performance, providing a more robust and flexible system
for managing plugins in Go applications.
2024-07-06 14:37:17 -04:00

37 lines
1.1 KiB
Go

// Copyright (C) 2024 Matt Dunleavy. All rights reserved.
// Use of this source code is subject to the MIT license
// that can be found in the LICENSE file.
package pluginmanager
import (
"errors"
"fmt"
)
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")
)
type PluginError struct {
Op string
Err error
Plugin string
}
func (e *PluginError) Error() string {
if e.Plugin != "" {
return fmt.Sprintf("plugin error: %s: %s: %v", e.Plugin, e.Op, e.Err)
}
return fmt.Sprintf("plugin error: %s: %v", e.Op, e.Err)
}
func (e *PluginError) Unwrap() error {
return e.Err
}