Documentation
¶
Index ¶
- func EnsureDirectories(config *PluginConfig) error
- func GetPluginApp() *core.BaseApp
- func GetPluginCmd() *cobra.Command
- func InitPluginCommands()
- func InitializePluginSystem(repoManager *repo.RepositoryManager) error
- func TriggerURLAdd(url interface{}, data map[string]interface{})
- func TriggerUserLogin(user interface{}, data map[string]interface{})
- func ValidatePluginConfig(config *PluginConfig) error
- type PendingRoute
- type PluginConfig
- type PluginConfigWrapper
- type PluginIntegration
- type PluginLoggerWrapper
- func (l *PluginLoggerWrapper) Debug(msg string, args ...interface{})
- func (l *PluginLoggerWrapper) Error(msg string, args ...interface{})
- func (l *PluginLoggerWrapper) Fatal(msg string, args ...interface{})
- func (l *PluginLoggerWrapper) Info(msg string, args ...interface{})
- func (l *PluginLoggerWrapper) Warn(msg string, args ...interface{})
- type PluginRouterWrapper
- func (r *PluginRouterWrapper) DELETE(path string, handler interface{})
- func (r *PluginRouterWrapper) GET(path string, handler interface{})
- func (r *PluginRouterWrapper) Group(path string) core.RouterInterface
- func (r *PluginRouterWrapper) PATCH(path string, handler interface{})
- func (r *PluginRouterWrapper) POST(path string, handler interface{})
- func (r *PluginRouterWrapper) PUT(path string, handler interface{})
- func (r *PluginRouterWrapper) Use(middleware interface{})
- type PluginUtils
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDirectories ¶
func EnsureDirectories(config *PluginConfig) error
EnsureDirectories 确保插件系统所需的目录存在
func InitializePluginSystem ¶
func InitializePluginSystem(repoManager *repo.RepositoryManager) error
InitializePluginSystem 初始化全局插件系统
func TriggerURLAdd ¶
func TriggerURLAdd(url interface{}, data map[string]interface{})
TriggerURLAdd 触发 URL 添加事件
func TriggerUserLogin ¶
func TriggerUserLogin(user interface{}, data map[string]interface{})
TriggerUserLogin 触发用户登录事件
func ValidatePluginConfig ¶
func ValidatePluginConfig(config *PluginConfig) error
ValidatePluginConfig 验证插件配置
Types ¶
type PendingRoute ¶
PendingRoute 待注册的路由
type PluginConfig ¶
type PluginConfig struct {
// 是否启用插件系统
Enabled bool `json:"enabled" env:"PLUGIN_ENABLED"`
// 是否启用热重载
HotReload bool `json:"hot_reload" env:"PLUGIN_HOT_RELOAD"`
// 钩子目录
HooksDir string `json:"hooks_dir" env:"PLUGIN_HOOKS_DIR"`
// 迁移目录
MigrationsDir string `json:"migrations_dir" env:"PLUGIN_MIGRATIONS_DIR"`
// 类型定义目录
TypesDir string `json:"types_dir" env:"PLUGIN_TYPES_DIR"`
// VM 池大小
VMPoolSize int `json:"vm_pool_size" env:"PLUGIN_VM_POOL_SIZE"`
// 是否启用调试模式
Debug bool `json:"debug" env:"PLUGIN_DEBUG"`
}
PluginConfig 插件系统配置
type PluginConfigWrapper ¶
type PluginConfigWrapper struct {
// contains filtered or unexported fields
}
PluginConfigWrapper 配置包装器
func (*PluginConfigWrapper) Get ¶
func (c *PluginConfigWrapper) Get(key string) interface{}
func (*PluginConfigWrapper) GetBool ¶
func (c *PluginConfigWrapper) GetBool(key string) bool
func (*PluginConfigWrapper) GetInt ¶
func (c *PluginConfigWrapper) GetInt(key string) int
func (*PluginConfigWrapper) GetString ¶
func (c *PluginConfigWrapper) GetString(key string) string
func (*PluginConfigWrapper) Set ¶
func (c *PluginConfigWrapper) Set(key string, value interface{})
type PluginIntegration ¶
type PluginIntegration struct {
// contains filtered or unexported fields
}
PluginIntegration 插件系统集成器
func GetGlobalPluginIntegration ¶
func GetGlobalPluginIntegration() *PluginIntegration
GetGlobalPluginIntegration 获取全局插件系统集成实例
func NewPluginIntegration ¶
func NewPluginIntegration(repoManager *repo.RepositoryManager) *PluginIntegration
NewPluginIntegration 创建插件系统集成器
func (*PluginIntegration) GetApp ¶
func (pi *PluginIntegration) GetApp() *core.BaseApp
GetApp 获取插件应用实例
func (*PluginIntegration) GetPluginManager ¶
func (pi *PluginIntegration) GetPluginManager() *plugin.Manager
GetPluginManager 获取插件管理器
func (*PluginIntegration) Initialize ¶
func (pi *PluginIntegration) Initialize() error
Initialize 初始化插件系统
func (*PluginIntegration) SetRouter ¶
func (pi *PluginIntegration) SetRouter(router *gin.Engine)
SetRouter 设置 Gin 路由器
type PluginLoggerWrapper ¶
type PluginLoggerWrapper struct{}
PluginLoggerWrapper 日志包装器
func (*PluginLoggerWrapper) Debug ¶
func (l *PluginLoggerWrapper) Debug(msg string, args ...interface{})
func (*PluginLoggerWrapper) Error ¶
func (l *PluginLoggerWrapper) Error(msg string, args ...interface{})
func (*PluginLoggerWrapper) Fatal ¶
func (l *PluginLoggerWrapper) Fatal(msg string, args ...interface{})
func (*PluginLoggerWrapper) Info ¶
func (l *PluginLoggerWrapper) Info(msg string, args ...interface{})
func (*PluginLoggerWrapper) Warn ¶
func (l *PluginLoggerWrapper) Warn(msg string, args ...interface{})
type PluginRouterWrapper ¶
type PluginRouterWrapper struct{}
PluginRouterWrapper 路由包装器
func (*PluginRouterWrapper) DELETE ¶
func (r *PluginRouterWrapper) DELETE(path string, handler interface{})
func (*PluginRouterWrapper) GET ¶
func (r *PluginRouterWrapper) GET(path string, handler interface{})
func (*PluginRouterWrapper) Group ¶
func (r *PluginRouterWrapper) Group(path string) core.RouterInterface
func (*PluginRouterWrapper) PATCH ¶
func (r *PluginRouterWrapper) PATCH(path string, handler interface{})
func (*PluginRouterWrapper) POST ¶
func (r *PluginRouterWrapper) POST(path string, handler interface{})
func (*PluginRouterWrapper) PUT ¶
func (r *PluginRouterWrapper) PUT(path string, handler interface{})
func (*PluginRouterWrapper) Use ¶
func (r *PluginRouterWrapper) Use(middleware interface{})
type PluginUtils ¶
type PluginUtils struct{}
PluginUtils 插件系统工具函数
func (*PluginUtils) CreatePluginTemplate ¶
func (p *PluginUtils) CreatePluginTemplate(pluginName, pluginType string) error
CreatePluginTemplate 创建插件模板文件
func (*PluginUtils) GetPluginStats ¶
func (p *PluginUtils) GetPluginStats() map[string]interface{}
GetPluginStats 获取插件统计信息
func (*PluginUtils) ValidatePlugin ¶
func (p *PluginUtils) ValidatePlugin(filePath string) error
ValidatePlugin 验证插件文件
Click to show internal directories.
Click to hide internal directories.