plugins

package
v0.0.0-...-737200f Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPlugin

type IPlugin interface {
	Run(config string) response.TResponse
	Running() response.TResponse
	Stop() response.TResponse
	GetConfigTemplate() response.TResponse
	// plugin 自定义接口
	CustomInterface(pluginOperate TPluginOperate) response.TResponse

	GetSystemUsage() string
}

type MsgpackCodec

type MsgpackCodec struct{}

func (MsgpackCodec) Decode

func (MsgpackCodec) Decode(data []byte, v interface{}) error

func (MsgpackCodec) Encode

func (MsgpackCodec) Encode(v interface{}) ([]byte, error)

type PluginImplement

type PluginImplement struct {
	Impl IPlugin
}

func (PluginImplement) Client

func (PluginImplement) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*PluginImplement) Server

func (imp *PluginImplement) Server(*plugin.MuxBroker) (interface{}, error)

type PluginRPC

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

func (*PluginRPC) CustomInterface

func (pRPC *PluginRPC) CustomInterface(pluginOperate TPluginOperate) response.TResponse

func (*PluginRPC) GetConfigTemplate

func (pRPC *PluginRPC) GetConfigTemplate() response.TResponse

func (*PluginRPC) GetSystemUsage

func (pRPC *PluginRPC) GetSystemUsage() string

func (*PluginRPC) Run

func (pRPC *PluginRPC) Run(config string) response.TResponse
func (pRPC *PluginRPC) Load(config string) response.TResponse {
	var result response.TResponse
	err := pRPC.client.Call("Plugin.Load",
		config,
		&result)
	if err != nil {
		return *response.Failure(err.Error())
	}
	return result
}

func (*PluginRPC) Running

func (pRPC *PluginRPC) Running() response.TResponse

func (*PluginRPC) Stop

func (pRPC *PluginRPC) Stop() response.TResponse

type PluginRPCServer

type PluginRPCServer struct {
	Impl IPlugin
}

func (*PluginRPCServer) CustomInterface

func (s *PluginRPCServer) CustomInterface(pluginOperate TPluginOperate, resp *response.TResponse) error

func (*PluginRPCServer) GetConfigTemplate

func (s *PluginRPCServer) GetConfigTemplate(args interface{}, resp *response.TResponse) error

func (*PluginRPCServer) GetSystemUsage

func (s *PluginRPCServer) GetSystemUsage(args interface{}, resp *string) error

func (*PluginRPCServer) Run

func (s *PluginRPCServer) Run(config string, resp *response.TResponse) error
func (s *PluginRPCServer) Load(config string, resp *response.TResponse) error {
	*resp = s.Impl.Load(config)
	return nil
}

func (*PluginRPCServer) Running

func (s *PluginRPCServer) Running(args interface{}, resp *response.TResponse) error

func (*PluginRPCServer) Stop

func (s *PluginRPCServer) Stop(args interface{}, resp *response.TResponse) error

type TPluginInfo

type TPluginInfo struct {
	PluginUUID     string `json:"plugin_uuid,omitempty"` //用于创建插件的目录
	PluginName     string `json:"plugin_name,omitempty"` //插件名称
	PluginType     string `json:"plugin_type,omitempty"` //插件类型(包括:接口插件,服务插件,数据推送,数据抽取,全部插件)
	PluginDesc     string `json:"plugin_desc,omitempty"` //插件描述
	PluginFileName string `json:"plugin_file_name,omitempty"`
	PluginConfig   string `json:"plugin_config,omitempty"`  //插件配置信息
	PluginVersion  string `json:"plugin_version,omitempty"` //插件版本号
	RunType        string `json:"run_type,omitempty"`       //启动类型(包括:自动启动、手动启动、禁止启动)
	SerialNumber   string `json:"serial_number,omitempty"`  //用于匹配插件的序列号
	Status         string `json:"status,omitempty"`         //插件状态(包括:待加载、待运行)
}

type TPluginOperate

type TPluginOperate struct {
	UserID      int32          `json:"user_id"`
	PluginUUID  string         `json:"plugin_uuid,omitempty"`
	OperateName string         `json:"operate_name"`
	Params      map[string]any `json:"params"`
}

Jump to

Keyboard shortcuts

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