bot

package
v0.0.0-...-701f7b7 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2014 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPlugin

func RegisterPlugin(name string, p PluginFactory)

Types

type Bot

type Bot struct {
	Log *logrus.Logger
	// contains filtered or unexported fields
}

func NewBot

func NewBot() (*Bot, error)

func (*Bot) Config

func (b *Bot) Config(name string, c interface{}) error

func (*Bot) Run

func (b *Bot) Run() error

type CoreConfig

type CoreConfig struct {
	Nick string
	User string
	Name string
	Pass string

	Host        string
	TLS         bool
	TLSNoVerify bool

	Cmds   []string
	Prefix string

	LogLevel string

	Plugins []string
}

type PluginFactory

type PluginFactory interface{}

Requirements for PluginFactories are as follows: 1. Be a function 2. Return at least 1 value 3. The last return value is an error

Anything before the last argument will be treated as values this plugin provides. Anything this package needs should be taken in as an argument to the constructor.

Unfortunately, PluginFactories are not type safe because of the requirements for dependency injection to work, but as plugins are only loaded on startup (and not for every event) these should be simple to test.

Jump to

Keyboard shortcuts

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