plugins

package
v0.0.0-...-efa4d4d Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package plugins defines support for plugins.

Each IRC command should have an associated symbol (function name) in the plugins. This function should have this signature: func Example(args []string, e *irc.Event) (reply string, action bool)

Each plugins must have a config file which defines IRC commands and the functions, matching the signature above, that implements them:

``` command1: function1 command2: function2 ```

Package plugins implements plugins support

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoExportedMatchers = errors.New("plugin has no exported matchers")
)

Exported error vars

Functions

func LoadPlugins

func LoadPlugins(config map[string]string) error

LoadPlugins loads plugins and their configuration into memory

Types

type Plugin

type Plugin struct {
	*plugin.Plugin
	// contains filtered or unexported fields
}

type PluginConf

type PluginConf struct {
	Config map[string]interface{} `yaml:"config"`
	// contains filtered or unexported fields
}

type Result

type Result struct {
	Message string
	Action  bool
}

func Execute

func Execute(command string, args []string, e *irc.Event) (Result, error)

func Matchers

func Matchers(msg string, e *irc.Event) ([]Result, error)

Jump to

Keyboard shortcuts

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