pluginmgr

package
v0.0.0-...-1c4572a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2018 License: BSD-2-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCmd

func AddCmd(rootCmd *cobra.Command)

func AddRPC

func AddRPC(s types.RPCServer)

func HasExec

func HasExec(name string) bool

func InitExec

func InitExec(sub map[string][]byte)

func InitWallet

func InitWallet(wallet wcom.WalletOperate, sub map[string][]byte)

func Register

func Register(p Plugin)

Types

type Plugin

type Plugin interface {
	// 获取整个插件的包名,用以计算唯一值、做前缀等
	GetName() string
	// 获取插件中执行器名
	GetExecutorName() string
	// 初始化执行器时会调用该接口
	InitExec(sub map[string][]byte)
	InitWallet(wallet wcom.WalletOperate, sub map[string][]byte)
	AddCmd(rootCmd *cobra.Command)
	AddRPC(s types.RPCServer)
}

type PluginBase

type PluginBase struct {
	Name     string
	ExecName string
	RPC      func(name string, s types.RPCServer)
	Exec     func(name string, sub []byte)
	Wallet   func(walletBiz wcom.WalletOperate, sub []byte)
	Cmd      func() *cobra.Command
}

func (*PluginBase) AddCmd

func (p *PluginBase) AddCmd(rootCmd *cobra.Command)

func (*PluginBase) AddRPC

func (p *PluginBase) AddRPC(c types.RPCServer)

func (*PluginBase) GetExecutorName

func (p *PluginBase) GetExecutorName() string

func (*PluginBase) GetName

func (p *PluginBase) GetName() string

func (*PluginBase) InitExec

func (p *PluginBase) InitExec(sub map[string][]byte)

func (*PluginBase) InitWallet

func (p *PluginBase) InitWallet(walletBiz wcom.WalletOperate, sub map[string][]byte)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL