plugin

package
v0.0.0-...-80248e1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Default

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

func NewDefault

func NewDefault(name string) *Default

func (*Default) Close

func (p *Default) Close() error

func (*Default) Init

func (p *Default) Init() error

func (*Default) Name

func (p *Default) Name() string

type IPlugin

type IPlugin interface {
	// Name 返回插件名称
	Name() string
	// Init 初始化插件
	Init() error
	// Close 关闭插件
	Close() error
}

IPlugin 配置插件接口

type Mgr

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

Mgr 插件管理器

func NewPluginManager

func NewPluginManager() *Mgr

NewPluginManager 创建插件管理器

func (*Mgr) Close

func (p *Mgr) Close() error

Close 关闭所有插件

func (*Mgr) Count

func (p *Mgr) Count() int

Count 返回已注册的插件数量

func (*Mgr) Get

func (p *Mgr) Get(name string) IPlugin

Get 获取插件

func (*Mgr) List

func (p *Mgr) List() []string

List 列出所有已注册的插件

func (*Mgr) Register

func (p *Mgr) Register(plugin IPlugin) error

Register 注册插件

func (*Mgr) Remove

func (p *Mgr) Remove(name string) error

Remove 移除插件-关闭插件并从管理器中删除

Jump to

Keyboard shortcuts

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