Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IApiPlugin ¶
type IApiPlugin interface {
Name() string //plugin名称
Describe() string //插件具体描述内容
Factory(*config.PluginData) IApiPluginFactory //工厂类,生成具体执行的插件
}
type IApiPluginCmdHandler ¶
type IApiPluginCmdHandler interface {
}
IApiPluginCmdHandler 插件命令行场景下需支持的处理
type IApiPluginFactory ¶
type IApiPluginFactory interface {
Do(param RunningParam)
HttpHandler() IApiPluginHttpHandler //该插件的具体handler类
CmdHandler() IApiPluginCmdHandler //该插件的具体handler类
}
type IApiPluginHandler ¶
type IApiPluginHandler interface {
Do(param RunningParam)
}
IApiPluginHandler 插件http场景下需支持的处理
type IApiPluginHttpHandler ¶
type IApiPluginHttpHandler interface {
Router() []config.GinHandleParam
}
IApiPluginHttpHandler 插件http场景下需支持的处理
type IApiPluginRPCHandler ¶
type IApiPluginRPCHandler interface {
}
IApiPluginRPCHandler 插件rpc场景下需支持的处理
type IAutoApi ¶
type IAutoApi interface {
IDataExec
IVars
Config() config.AutoApiDefined
Code() string //唯一code
ShowName() string //展示名称
Init() error //初始化
Handlers() []config.GinHandleParam
}
type IAutoApiDataExec ¶
type IAutoApiDataExec interface {
IDataExecBase
IDataExecCURD
}
IAutoApiDataExec 自定义的数据执行器
type IAutoApiHelp ¶
type IAutoApiHelp interface {
Config() config.AutoApiDefined
GetDataExec() IAutoApiDataExec
GetVars() map[string]string //全局参数
}
type IDataExec ¶
type IDataExec interface {
SetDataExec(IAutoApiDataExec) //设置数据处理器-负责初始化数据库,操作数据CURD的相关操作
GetDataExec() IAutoApiDataExec
}
IDataExec dataExec操作
type IDataExecBase ¶
type IDataExecBase interface {
TableName() string
InitDB(name string, c config.AutoApiDataDefined) error
Copy() IAutoApiDataExec
}
type IDataExecCURD ¶
type IDataExecCURD interface {
DoSearch(params map[string]interface{}, fields []string, page, size int) ([]map[string]interface{}, int64, error)
DoQuery(params map[string]interface{}, fields []string) (map[string]interface{}, error)
DoCreate(params map[string]interface{}) (int64, error)
DoUpdate(id int64, params map[string]interface{}) (int64, error)
DoDelete(id int64) (int64, error)
}
type RunningParam ¶
type RunningParam interface {
Ctx() context.Context
GinCtx() *gin.Context
DataExec() IDataExecCURD
Abort() //终止处理
GetVar(string) interface{}
SetVar(string, interface{})
}
RunningParam 运行时使用的参数合集
Click to show internal directories.
Click to hide internal directories.