增加插件接口及插件结果定义

This commit is contained in:
2024-11-13 17:54:44 +08:00
parent 8022a8533f
commit 942cd1dfed
3 changed files with 78 additions and 7 deletions

24
define/plugin.go Normal file
View File

@ -0,0 +1,24 @@
// Package define ...
//
// Description : define ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2024-11-13 17:26
package define
// PluginResult 插件执行结果
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 17:28 2024/11/13
type PluginResult struct {
ID string `json:"id"` // 插件ID
StartTime int64 `json:"start_time"` // 开始执行时间: ms
FinishTime int64 `json:"finish_time"` // 完成执行时间: ms
IsSuccess bool `json:"is_success"` // 是否成功
SkipFailure bool `json:"skip_failure"` // 执行失败跳过异常继续执行
Data map[string]any `json:"data"` // 输出的数据
ErrMsg string `json:"err_msg"` // 失败原因
Config map[string]any `json:"config"` // 插件的配置数据
}