Documentation ¶
Index ¶
- Variables
- type Action
- type CallRequest
- type CallResult
- func (cr *CallResult) AddData(key string, value interface{})
- func (cr *CallResult) Error(msg string, arg ...string)
- func (cr *CallResult) Result() (data map[string]interface{}, success bool, msg string)
- func (cr *CallResult) Success(data map[string]interface{})
- func (cr *CallResult) SuccessMsg(msg string, arg ...string)
- func (cr *CallResult) Trans(v interface{}) error
- type Plugin
- type PluginFunction
- type PluginFunctionInterface
- type PluginInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var NewPluginFunction = func(FunctionName, FunctionNameDesc, FunctionDesc string) *PluginFunction { return &PluginFunction{ functionInfo: po.Function{ FunctionName: FunctionName, FunctionNameDesc: FunctionNameDesc, FunctionDesc: FunctionDesc, }, } }
Functions ¶
This section is empty.
Types ¶
type CallRequest ¶
type CallRequest struct { FuncName string `json:"func_name"` Args []interface{} `json:"args"` // contains filtered or unexported fields }
CallRequest 异步调用请求
func (*CallRequest) GetFloat64 ¶ added in v0.0.7
func (c *CallRequest) GetFloat64(index int) (i float64, err error)
type CallResult ¶
type CallResult struct { Code string `json:"code"` //0 成功 1失败 Msg string `json:"msg"` //信息 Data map[string]interface{} `json:"data"` //结果 }
CallResult 返回值
func (*CallResult) AddData ¶
func (cr *CallResult) AddData(key string, value interface{})
func (*CallResult) Error ¶
func (cr *CallResult) Error(msg string, arg ...string)
func (*CallResult) Result ¶
func (cr *CallResult) Result() (data map[string]interface{}, success bool, msg string)
func (*CallResult) Success ¶
func (cr *CallResult) Success(data map[string]interface{})
func (*CallResult) SuccessMsg ¶ added in v0.0.7
func (cr *CallResult) SuccessMsg(msg string, arg ...string)
func (*CallResult) Trans ¶
func (cr *CallResult) Trans(v interface{}) error
type Plugin ¶
type Plugin struct { AppInfo po.AppInfo PluginFunctions map[string]PluginFunctionInterface }
func (Plugin) Call ¶
func (p Plugin) Call(request CallRequest, result *CallResult) error
type PluginFunction ¶
type PluginFunction struct {
// contains filtered or unexported fields
}
func (*PluginFunction) Action ¶
func (p *PluginFunction) Action(action Action) *PluginFunction
func (PluginFunction) Info ¶ added in v0.0.6
func (p PluginFunction) Info() po.Function
func (PluginFunction) Name ¶ added in v0.0.6
func (p PluginFunction) Name() string
func (*PluginFunction) SetArgs ¶
func (p *PluginFunction) SetArgs(args ...po.Arg) *PluginFunction
type PluginFunctionInterface ¶
type PluginFunctionInterface interface { Name() string Info() po.Function // contains filtered or unexported methods }
PluginFunctionInterface 插件方法接口
type PluginInterface ¶
type PluginInterface interface {
Call(request CallRequest, result *CallResult) error
}
PluginInterface 插件接口
Source Files ¶
Click to show internal directories.
Click to hide internal directories.