extend

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Type    string                 // 管理器处理的插件类型的id
	Glob    string                 // 全局的插件文件名
	Path    string                 // 插件路径
	Plugins map[string]*PluginInfo // 插件信息列表
	// contains filtered or unexported fields
}

Manager 为不同类型的插件,管理的生命周期

func NewManager

func NewManager(ptype, glob, dir string, pluginImpl plugin.Plugin) *Manager

func (*Manager) Dispose

func (m *Manager) Dispose()

func (*Manager) GetInterface

func (m *Manager) GetInterface(id string) (interface{}, error)

func (*Manager) Init

func (m *Manager) Init() error

func (*Manager) Launch

func (m *Manager) Launch() error

type PluginInfo

type PluginInfo struct {
	ID     string
	Path   string
	Client *plugin.Client
}

type SysPlugin

type SysPlugin struct {
	// contains filtered or unexported fields
}

func GetNoticePlugin

func GetNoticePlugin() *SysPlugin

GetNoticePlugin 构造方法

func GetProtocolPlugin

func GetProtocolPlugin() *SysPlugin

GetProtocolPlugin 构造方法

func (*SysPlugin) GetProtocolPlugin added in v1.0.5

func (pm *SysPlugin) GetProtocolPlugin(protocolName string) (obj module.Protocol, err error)

GetProtocolPlugin 获取指协议名称的插件

func (*SysPlugin) GetProtocolUnpackData

func (pm *SysPlugin) GetProtocolUnpackData(protocolType string, data []byte) (res model.JsonRes, err error)

GetProtocolUnpackData 通过协议解析插件处理后,获取解析数据。protocolType 为协议名称 todo 需要标记数据协议子类型

func (*SysPlugin) NoticeSend

func (pm *SysPlugin) NoticeSend(noticeName string, msg model.NoticeInfoData) (res string, err error)

NoticeSend 通过插件发送通知信息。noticeName 为通知插件名称;msg为通知内容

Directories

Path Synopsis
consts

Jump to

Keyboard shortcuts

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