engine

package module
v0.0.0-...-8468317 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Plugins 所有的插件配置
	Plugins = make(map[string]*Plugin)

	// Engine 复用安装插件逻辑,将全局配置信息注入
	Engine = InstallPlugin(config.Global)
)

Functions

func InitRobot

func InitRobot()

func Run

func Run(ctx context.Context, configPath string) (err error)

Run 启动engine,注册plugin

Types

type Plugin

type Plugin struct {
	context.Context
	context.CancelFunc
	PluginMagic

	Config    config.Plugin // 插件配置
	RawConfig config.Config // 插件原配置
}

func InstallPlugin

func InstallPlugin(conf config.Plugin) *Plugin

func (*Plugin) Assign

func (p *Plugin) Assign()

type PluginMagic

type PluginMagic struct {
	Name       string   // 插件名字
	Desc       string   // 插件描述
	Commands   []string // 插件命令
	HiddenMenu bool     // 是否隐藏菜单
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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