Documentation
¶
Overview ¶
Package pluginmgr 插件管理模块,负责插件初始化等功能
Index ¶
- func AddCmd(rootCmd *cobra.Command)
- func AddRPC(s types.RPCServer)
- func GetExecList() (datas []string)
- func HasExec(name string) bool
- func InitExec(cfg *typ.TuringchainConfig)
- func InitWallet(wallet wcom.WalletOperate, sub map[string][]byte)
- func Register(p Plugin)
- type Plugin
- type PluginBase
- func (p *PluginBase) AddCmd(rootCmd *cobra.Command)
- func (p *PluginBase) AddRPC(c types.RPCServer)
- func (p *PluginBase) GetExecutorName() string
- func (p *PluginBase) GetName() string
- func (p *PluginBase) InitExec(cfg *typ.TuringchainConfig)
- func (p *PluginBase) InitWallet(walletBiz wcom.WalletOperate, sub map[string][]byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitWallet ¶
func InitWallet(wallet wcom.WalletOperate, sub map[string][]byte)
InitWallet init wallet plugin
Types ¶
type Plugin ¶
type Plugin interface {
// 获取整个插件的包名,用以计算唯一值、做前缀等
GetName() string
// 获取插件中执行器名
GetExecutorName() string
// 初始化执行器时会调用该接口
InitExec(cfg *typ.TuringchainConfig)
InitWallet(wallet wcom.WalletOperate, sub map[string][]byte)
AddCmd(rootCmd *cobra.Command)
AddRPC(s types.RPCServer)
}
Plugin plugin module struct
type PluginBase ¶
type PluginBase struct {
Name string
ExecName string
RPC func(name string, s types.RPCServer)
Exec func(name string, cfg *typ.TuringchainConfig, sub []byte)
Wallet func(walletBiz wcom.WalletOperate, sub []byte)
Cmd func() *cobra.Command
}
PluginBase plugin module base struct
func (*PluginBase) AddCmd ¶
func (p *PluginBase) AddCmd(rootCmd *cobra.Command)
AddCmd add Command for plugin cli
func (*PluginBase) AddRPC ¶
func (p *PluginBase) AddRPC(c types.RPCServer)
AddRPC add Rpc for plugin
func (*PluginBase) GetExecutorName ¶
func (p *PluginBase) GetExecutorName() string
GetExecutorName 获取插件中执行器名
func (*PluginBase) InitExec ¶
func (p *PluginBase) InitExec(cfg *typ.TuringchainConfig)
InitExec init exec
func (*PluginBase) InitWallet ¶
func (p *PluginBase) InitWallet(walletBiz wcom.WalletOperate, sub map[string][]byte)
InitWallet init wallet plugin
Click to show internal directories.
Click to hide internal directories.